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.

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}]";
share|improve this question
1  
Just a side note, don't copy the zoneinfo files, link them instead. –  Michael Hampton Sep 27 '13 at 19:16
    
MST isn't even in use at this time of year.. PDT is currently -7, though. Seems like something's very wrong with your America/New_York, if you're getting Therefore TZ='America/New_York' will be used. then Local time is now: Fri Sep 27 11:22:56 MST 2013. –  Shane Madden Sep 27 '13 at 19:19
    
@ShaneMadden It is in Arizona. –  Michael Hampton Sep 27 '13 at 19:20
1  
@MichaelHampton Arizona doesn't count! ;) –  Shane Madden Sep 27 '13 at 19:21
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.