1

It seems as if the server thinks New York is MST, despite all my efforts of trying to set it to EST. Just what is going on here? The time in New York is actually 2:22PM EST, but my server is stuck 3 hours beforehand. I thought maybe the zoneinfo files were outdated, so I ran yum update tzdata, but there was nothing to update.

Here is my time setup:

After copying EST file zone

# rm /etc/localtime; cp /usr/share/zoneinfo/EST /etc/localtime

Also tried

# rm /etc/localtime; cp /usr/share/zoneinfo/US/Eastern /etc/localtime

And

# rm /etc/localtime; cp /usr/share/zoneinfo/America/New_York /etc/localtime

I set the system clock

# cat /etc/sysconfig/clock
ZONE="America/New_York"
UTC=false
ARC=false

I run tzselect

Therefore TZ='America/New_York' will be used.
Local time is now:      Fri Sep 27 11:22:56 MST 2013.
Universal Time is now:  Fri Sep 27 18:22:56 UTC 2013.
Is the above information OK?
1) Yes
2) No
#? (canceled)

Run ntpdate

# ntpdate 0.centos.pool.ntp.org
adjust time server 199.30.140.74 offset 0.006327 sec

The system time isn't correct:

# date
Fri Sep 27 11:22:31 MST 2013

Hardware clock reflects the incorrect system time:

# hwclock --show
Fri 27 Sep 2013 11:22:37 AM MST  -0.297177 seconds

Apache time is also wrong:

09/27/2013 11:22:26am [America/New_York]

Code:

date_default_timezone_set('America/New_York');
$z = date_default_timezone_get();
$date = new DateTime();
echo $date->format('m/d/Y H:i:sa') . " [{$z}]";
Lakitu
  • 137
  • 1
  • 6

0 Answers0