10

Different operating systems seem to handle daylight-saving time(DST) differently. I really like the Cisco IOS approach which is very simple and allows one to change the date and time when DST starts and ends. For example:

clock summer-time EDT recurring 2 Sun Mar 2:00 1 Sun Nov 2:00 60

..sets clock 60 minutes ahead on the Sunday of second week of March at 2:00 and shifts clock 60 minutes back on first Sunday on November at 2:00. How Linux handles DST? I know that there is a tzdata package which contains timezone data files and those files are installed to /usr/share/zoneinfo/ directory. How and by which utilities are those files used? I can see the the shift from UTC(2) and time-zone names(EET and EEST) in file:

T60:~# strings /usr/share/zoneinfo/posix/Europe/Helsinki
TZif2
    HMT
EEST
TZif2
EEST
EET-2EEST,M3.5.0/3,M10.5.0/4
T60:~# 

In addition, M3 is probably third month and M10 is a tenth month? In addition, offset should be also specified somewhere. For example in IOS one can configure that once the DST happens, the clock shifts for example 90 or 120 minutes instead of 60.

Martin
  • 7,516

1 Answers1

4

If you take a look at the Wikipedia page regarding the TZ database:

excerpt

File formats

The tz database is published as a set of text files which list the rules and zone transitions in a human-readable format. For use, these text files are compiled into a set of platform-independent binary files—one per time zone. The reference source code includes such a compiler called zic (zone information compiler), as well as code to read those files and use them in standard APIs such as localtime() and mktime().

Additional searching turned up this Q&A on stackoverflow, titled: Timezone database file format question, which had additional information on the file format.

slm
  • 369,824