How to Check and Update Daylight Savings Time Information in Linux

If you haven’t already heard, Because of The Energy Policy Act of 2005 Daylight Savings Time in the USA will start 3 weeks earlier at 2am on the second Sunday in March and end one week later at 2am on the first Sunday in November. It’s important that you check your current settings to make sure you don’t have any issues or get your time out of sync. Even if you have your time updated via NTP, you aren’t covered. NTP operates by setting your computer time to UTC or Universal Standard Time. Your computer then calculates the correct local time according to your time zone settings.


If you are wondering if your Linux system has the updated daylight savings time settings for 2007 there is a simple command you can run to check.

(*note: Commands preceded by a “$” are run as a normal user and commands preceded by a “#” are run as root.)

Run the following command as root:

# zdump -v /etc/localtime | grep 2007

If the output looks something like below you are golden. The important part is to check that the Spring forward date is March 11th and the Fall back date is November 4th.

/etc/localtime Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800

If that’s not the case you can manually update your time zone files with the following technique:

$ su

# cd /tmp

# ftp elsie.nci.nih.gov

login user: anonymous
password: youremail@yourdomain.com

# cd pub

# ls

# get tzdata2007c.tar.gz

# quit

# tar xzvf tzdata2007c.tar.gz

# cp /etc/localtime /etc/localtime.OLD

# rm /etc/localtime

# zic northamerica

For the following command, make sure you use the file specific to your time zone. My example uses the US Pacific Standard Time.

# ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime

# zdump -v /etc/localtime | grep 2007

Now you should see the updated time zone information.

Tags: , , , , , ,

12 Comments so far »

  1. Fred Y. said,

    Wrote on March 25, 2007 @ 3:27 am

    Thanks so much for this great step by step fix. I was actually noticing this problem on my server and thanks to you, I was able to fix this myself rather easily :) Saved me some money from having my webhost technicians do it for me

  2. Mark said,

    Wrote on March 27, 2007 @ 6:31 am

    @ Fred: That’s good news Fred, I’m glad it was helpful.

  3. shivakumar said,

    Wrote on January 31, 2008 @ 11:00 pm

    Thank you very much.

    These simple steps help me a lot for DST enabling in my machine…

  4. Paul B said,

    Wrote on March 23, 2008 @ 7:07 am

    Thanks for the concise step by step, it worked fine when a few changes where accounted for. The file name has changed to (as of 032208) tzdata2008a.tar.gz. This new file gives a directory called ‘America’ instead of ‘US’ when zic northamerica is run. I ended up with ln -s /usr/share/zoneinfo/America/Chicago /etc/localtime for the symlink. Hopefully this note can save some head scratching.

    Paul

  5. Hector said,

    Wrote on March 26, 2008 @ 5:57 am

    Here’s the thing, I do the update as indicated above and the everything is pointing now for a DST that started on March 9, but for some weird reason now my server’s time is ahead 1hr. Any advice ?

  6. werutzb said,

    Wrote on October 7, 2008 @ 5:17 pm

    Hi!

    I would like make better my SQL capabilities.
    I red so many SQL resources and would like to
    read more about SQL for my position as db2 database manager.

    What can you recommend?

    Thanks,
    Werutz

  7. порно said,

    Wrote on October 15, 2008 @ 2:28 pm

    Реально занимательное место, мне тут понравилось, правда…
    Столько всего полезного и интересного, я тут останусь на долго.

  8. анал said,

    Wrote on October 16, 2008 @ 10:50 am

    Очень классное место, мне тут понравилось, правда…
    Столько всего суперского и позновательного, я тут задержусь на долго.

  9. JeyramoXRu said,

    Wrote on October 16, 2008 @ 10:48 pm

    Hi boys and girls ;-)
    Anybody can give me url to the XRumer’s homepage?
    Or maybe some information…

    Thank you very much!!!

    P.S. Вот уроды…

  10. PemnramiTedia said,

    Wrote on October 19, 2008 @ 4:37 pm

    Test message
    Sorry me noob…

  11. Unrendunalley said,

    Wrote on October 23, 2008 @ 6:21 am

    There was this guy see.
    He wasn’t very bright and he reached his adult life without ever having learned “the facts”.
    Somehow, it gets to be his wedding day.
    While he is walking down the isle, his father tugs his sleeve and says,

    “Son, when you get to the hotel room…Call me”

    Hours later he gets to the hotel room with his beautiful blushing bride and he calls his father,

    “Dad, we are the hotel, what do I do?”

    “O.K. Son, listen up, take off your clothes and get in the bed, then she should take off her clothes and get in the bed, if not help her. Then either way, ah, call me”

    A few moments later…

    “Dad we took off our clothes and we are in the bed, what do I do?”

    O.K. Son, listen up. Move real close to her and she should move real close to you, and then… Ah, call me.”

    A few moments later…

    “DAD! WE TOOK OFF OUR CLOTHES, GOT IN THE BED AND MOVED REAL CLOSE, WHAT DO I DO???”

    “O.K. Son, Listen up, this is the most important part. Stick the long part of your body into the place where she goes to the bathroom.”

    A few moments later…

    “Dad, I’ve got my foot in the toilet, what do I do?”

  12. freedating said,

    Wrote on November 14, 2008 @ 10:17 am

    Have you ever visited free dating sites. Which are the best?
    Send me addresses please. I tried a lot of them with no luck in relationships.

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: