Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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. (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 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

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: 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


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.