1

So I've got a Linux machine running CentOS 6.5 and I've been trying to correct its timezone. I got it set once but for some reason it won't stay to what I set it as. The following steps I have performed to get it changed are;

  • Replaced ;default.timezone= in my php.ini file by default.timezone="UTC" and rebooted my web server.
  • Ran cp /usr/share/zoneinfo/GMT-0 /etc/localtime which sets the timezone to GMT-0 which is also UTC.
  • Installed NTP which will catch the server up to localtime: yum -y install ntp
  • Last but not least to get NTP properly going, ran ntpdate pool.ntp.org

Am I missing something or am I doing something incorrect?

Hopefully this is enough information!

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
  • 1
    Can we see some evidence that it's not working? – MadHatter Oct 29 '14 at 07:27
  • There's absolutely no useful description of the problem here. Is it the timezone that won't stay set or the time? If the zone, what does it change to/from? If the time, does it stop? Jump forward? Always become off by the same amount? Or what? – David Schwartz Oct 29 '14 at 07:44
  • I use xenForo forum software which is hosted on my Linux server. The default forum timezone is set to UTC globally but because the server time is not remaining as UTC when I set it, it's causing all timezone's to display the wrong time on the forums. However, as stated in the OP.. when I update the server time to UTC in my php.ini file then run the NTP stuff, the times display correctly on the forums. That being said, the servers timezone will randomly change back to the timezone it was set to before I updated it causing the forum times to then be incorrect. – user2947406 Oct 30 '14 at 01:39
  • Example; My timezone is set to Arizona on the forum, and it's saying the time is 1:41 PM when it's actually 6:41 PM here in AZ. But if the forum is globally set to UTC and the server as well and I had my timezone set to UTC on the forums, it would say 1:41 AM.. Not 1:41 PM. – user2947406 Oct 30 '14 at 01:43

0 Answers0