0

When I run ntpdate, my system clock displays the time as an hour behind what it should be. I know that ntpdate does everything in UTC, so I'm guessing there's a timezone setting wrong and it's ignoring Daylight Savings Time, but I can't figure it out.

Here's what I've done so far:

  • ln -sf /usr/share/zoneinfo/EST /etc/localtime to set the timezone
  • Set UTC=true in /etc/sysconfig/clock so that DST will be automatically applied
  • date -s hh:mm::ss to set system clock correctly
  • hwclock -systohc --utc to set the hardware clock correctly

At this point date and hwclock both display the correct time.

But if I then run ntpdate 0.us.pool.ntp.org, the date output is an hour behind what it should be.

I've looked at a dozen tutorials and can't figure out what I'm doing wrong. Does anyone have any ideas?

2
  • 1
    Does date -u return the correct UTC time? If not, the clock isn't set correctly. Set the clock correctly before you do anything else. Then you know any remaining problems are due to time zone settings. Mar 19, 2012 at 22:30
  • Yes, it does. The problem was using EST instead of EST5EDT.
    – Ian Dunn
    Mar 20, 2012 at 15:58

1 Answer 1

3

IIRC EST is short for Eastern Standard Time, and not subject to DST. I'm guessing what you really want to use is /usr/share/zoneinfo/America/New_York, but my guess as to where you are might be off.

Edit:

Kyle Jones suggests to use EST5EDT, which is quite possibly a better choice. I'm coloured by familiarity with cases where national capitals are suitable, unambiguous references for the time zone in the country.

3
  • 1
    You are correct. He set his time to EST, so he's getting EST. If he wants to switch from EST to and from EDT, he'll need to pick a zone that does so according to the rules he wants it to follow. Mar 19, 2012 at 22:44
  • 2
    EST5EDT instead of EST is the usual choice.
    – Kyle Jones
    Mar 19, 2012 at 23:28
  • Ah, ok, I didn't realize that EST wouldn't automatically switch between -5 and -4. I'll use EST5EDT from now on. Thanks :)
    – Ian Dunn
    Mar 20, 2012 at 15:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .