0

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?

Matt Rogers
  • 83
  • 1
  • 7
  • 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)? –  May 16 '11 at 09:10

1 Answers1

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.

  • 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: http://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. –  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. –  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. –  May 16 '11 at 16:25