Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hey All, Got a box running Debian. I've set the root user time to the correct BST time. However, when I log in the server time and date which is shown is wrong:

e.g. http://www.5bars.co.uk/time.png (sorry no imageembedding for newbs like me)

This makes predicting when crons run rather challenging!

Further PHP scripts running on the box report the correct time, but the wrong time zone! How do I get everything synced up correctly?

share|improve this question

migrated from stackoverflow.com May 16 '11 at 22:14

This question came from our site for professional and enthusiast programmers.

    
Is the time show with correct time-zone for root? Do you not have TZ environment variable set for root (you need to be sure you are using the system timezone setting there)? –  Jan Hudec May 16 '11 at 9:10

1 Answer 1

Debian provides /usr/bin/tzselect to reconfigure the timezone.

If some users do not appear to have the correct timezone set check that they don't override the timezone with the TZ environment variable. Executing set logged in as the specific user shows all the environment variables and their current values.

share|improve this answer
    
Thanks Ruben, that's got me to the point where Debian has correctly set the date of universal time. But PHP is still reporting the wrong time. The "Universal time" reported at the end of the utility you suggested now shows GMT, which I can work with, but this script: demo3.feedspark.com/time shows another time entirely, and I've no idea what time it is. This also seems to be the time which crontab runs. Thanks in advance, by the way. –  Matt Rogers May 16 '11 at 12:34
    
Matt, you need to check if the user that runs the Apache process does not override the timezone. I edited the post. –  Ruben May 16 '11 at 14:00
    
I managed to solve it, but I'm not 100% sure what the change was that got it to work. Effectively it was the Windoze equivalent of clicking on things. However, we're now in the right timezone and crontab is running when I expect! Thanks for your help. –  Matt Rogers May 16 '11 at 16:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.