Monday, March 12, 2007

My Computer Is Switched to Daylight Savings Time, Is Yours?

So I managed the transition to daylight savings time. Three weeks early this year, thanks to a meddlesome Congress. I even got my computer adjusted for DST, despite the fact that my usual Mandriva 2006 repository out there somehow neglected to post the update in time.

Really, setting your computer to work with the new DST dates is simple, and amazingly cool, if like me you're something of a Linux propellerhead. All you need to do is go to the BASH command line (not to be confused with the DOS command line) and use wget to download from a government FTP site a tarball which contains the latest DST settings:

$ wget ftp://elsie.nci.nih.gov/pub/tzdata2007c.tar.gz

Then create a temporary directory and untar the tarball in it:

$ mkdir test; mv tzdata2007c.tar.gz test; cd test
$ tar -zxvf tzdata2007c.tar.gz

At this point you will have to use zic to format the data properly, then log in as root user and copy it to /usr/share/zoneinfo:

$ zic -d zoneinfo northamerica
$ su
Password:
# cd zoneinfo
# cp -r * /usr/share/zoneinfo/

Then you will have to set /etc/localtime to the values for your timezone, in my case Central Time. There are a couple of ways to do this, I found it simplest to force a symlink:

# ln -fs /usr/share/zoneinfo/CST6CDT /etc/localtime

And voilà! You can run zdump to verify that DST now begins on your system on the correct new date:

$ zdump -v /etc/localtime | grep 2007
/etc/localtime Sun Mar 11 07:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 CST isdst=0 gmtoff=-21600
/etc/localtime Sun Mar 11 08:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 CDT isdst=1 gmtoff=-18000
/etc/localtime Sun Nov 4 06:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 CDT isdst=1 gmtoff=-18000
/etc/localtime Sun Nov 4 07:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 CST isdst=0 gmtoff=-21600

Certain items running on your system will have to be restarted to use the new time data, may be simplest just to reboot.

And that's all there is to it.

Ummm, your computer uses Windows instead of Linux? Sorry, I haven't a clue...

Labels:

0 Comments:

Post a Comment

<< Home