Adding or changing time zone settings
To add to or edit the time zone data for
Wclock, edit the file wclocktz.ini.
This should be in the Wclock subdirectory of your personal %APPDATA%
folder
(see where is the wclocktz.ini file?).
To specify a new time zone you need to specify a POSIX.1 TZ string. The full details are specified in POSIX 1003.1 section 8.3. See Explanation of TZ strings below.
You must use the full expanded format; namely:
stdoffset[dst[offset][,start[/time],end[/time]]]
The full POSIX.1 standard is available for free in HTML format from The Open Group Base Specifications (requires registering). A summary of the syntax of TZ strings is explained here.
An entry for a location that has daylight saving looks like:
[Pacific/Auckland] TZ=NZST-12NZDT,M10.1.0/2,M3.3.0/3
For a location that does not have daylight saving, an entry looks like:
[Pacific/Honolulu] TZ=HST10
Caution: edit this file at your own risk. We have provided some TZ values that we believe are correct but we offer no guarantees on their validity.
It's up to you to derive the correct POSIX.1 TZ string for any new time zones you want to add. If the politicians in the zone in question mess around with the timing of daylight saving every year, you will have to edit the file to suit every year, too.
Explanation of TZ strings
General format of an entry in the filewclocktz.ini
:
[continent/city] TZ=posix-tz-stringTime zones that do not have daylight savings have a simple TZ string, e.g.
[Pacific/Honolulu] TZ=HST10Where
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-8Minutes 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 the IANA Time Zone Database.
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:01Newfoundland'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:45Atlantis 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.
Contact us
Any comments, feedback, questions please send us a message.
This page last updated: 29 August 2017