Explanation of TZ strings

General format of an entry in the file wclocktz.ini:
[continent/city]
TZ=posix-tz-string
Time zones that do not have daylight savings have a simple TZ string, e.g.
[Pacific/Honolulu]
TZ=HST10
Where HST is the designation for the time zone (in this case Hawaii Standard Time) and 10 is the offset in hours. The offset indicates the value one must add to the local time to arrive at Coordinated Universal Time (UTC, aka GMT), and so it is positive for west of the meridian, e.g. America, and negative for east, e.g. China.
[Asia/Beijing]
TZ=CST-8
Minutes and seconds are optional, so CST-8 and CST-08:00:00 mean the same thing. Note that the sign convention (+/-) used in a Posix TZ string is the opposite to that used in Internet time offsets (RFC 3339) and in Arthur David Olson's TZ data files.

Let's examine the TZ string for a city with daylight saving time

[America/New_York]
TZ=EST5EDT,M3.2.0/2,M11.1.0
EST = designation for standard time when daylight saving is not in force
5 = offset in hours = 5 hours west of Greenwich meridian (i.e. behind UTC)
EDT = designation when daylight saving is in force (if omitted there is no daylight saving)
, = no offset number between code and comma, so default to one hour ahead for daylight saving
M3.2.0 = when daylight saving starts = the 0th day (Sunday) in the second week of month 3 (March)
/2, = the local time when the switch occurs = 2 a.m. in this case
M11.1.0 = when daylight saving ends = the 0th day (Sunday) in the first week of month 11 (November). No time is given here so the switch occurs at 02:00 local time.

So daylight saving starts on the second sunday in March and finishes on the first Sunday in November. The switch occurs at 02:00 local time in both cases. This is the default switch time, so the /2 isn't strictly needed.

[Europe/Paris]
TZ=CET-1CEST,M3.5.0/2,M10.5.0/3
CET = designation for standard time when daylight saving is not in force
-1 = offset in hours = negative so 1 hour east of Greenwich meridian
CEST = designation when daylight saving is in force ("Central European Summer Time")
, = no offset number between code and comma, so default to one hour ahead for daylight saving
M3.5.0 = when daylight saving starts = the last Sunday in March (the "5th" week means the last in the month)
/2, = the local time when the switch occurs = 2 a.m. in this case
M10.5.0 = when daylight saving ends = the last Sunday in October.
/3, = the local time when the switch occurs = 3 a.m. in this case

The European Union time zones are arranged so the switch takes place at the same time in all zones.

[America/St_Johns]
TZ=NST03:30NDT,M3.2.0/0:01,M11.1.0/0:01
Newfoundland's standard time is three and a half hours behind UTC with daylight saving beginning on the second Sunday in March and ending on the first Sunday in November, but the switch occurs at one minute past midnight local time.

As an extreme example, consider the mythical city of Foobar in Atlantis.

[Atlantis/Foobar]
TZ=AST2:45ADT0:45,M4.1.6/1:45,M10.5.6/2:45
Atlantis Standard Time (AST) is 2 hours 45 minutes behind UTC and for daylight saving (ADT) they put their clocks forward two hours (i.e. to be 45 minutes behind UTC). Daylight saving starts on the first Saturday in April with the switch happening at 01:45 in the morning, and daylight saving ends on the last Saturday in October with the switch at 02:45 local time.

Read the full syntax of Posix TZ strings.


Copyright © 2005-17 D.I. Management Services Pty Limited
www.di-mgt.com.au