|
|
The TZ variable is assigned a string formatted as shown in the ``Format'' section. The fields are:
Four different rules are available for defining the start and end of summer time:
n
364) *
n
365) *
d
6)** of week n
(1
n
53)
+
n
5)
++
of month m (1
m
12)
If start and end are omitted, current U.S. law is assumed.
TZ='EST5EDT'where ``EST'' is the abbreviation for the main time zone, ``5'' is the difference, in hours, between GMT (Greenwich Mean Time) and the main time zone, and ``EDT'' is the abbreviation for the alternate time zone.
The most complex representation of the same setting, for the year 1986, is
TZ='EST5:00:00EDT4:00:00,117/2:00:00,299/2:00:00'where ``EST'' is the abbreviation for the main time zone, ``5:00:00'' is the difference, in hours, minutes, and seconds between GMT and the main time zone, ``EDT'' is the abbreviation for the alternate time zone, ``4:00:00'' is the difference, in hours, minutes, and seconds between GMT and the alternate time zone, ``117'' is the number of the day of the year (0 based Julian day) when the alternate time zone will take effect, ``2:00:00'' is the number of hours, minutes, and seconds past midnight when the alternate time zone will take effect, ``299'' is the number of the day of the year when the alternate time zone will end, and ``2:00:00'' is the number of hours, minutes, and seconds past midnight when the alternate time zone will end.
A southern hemisphere setting such as the Cook Islands could be
TZ='KDT9:30KST10:00,64/5:00,303/20:00'This setting means that ``KDT'' is the abbreviation for the main time zone, ``KST'' is the abbreviation for the alternate time zone, KST is 9 hours and 30 minutes later than GMT, KDT is 10 hours later than GMT, the starting date of KDT is the 64th day at 5 AM, and the ending date of KDT is the 303rd day at 8 PM.
Starting and ending times are relative to the alternate time zone. If the alternate time zone start and end dates and the time are not provided, the days for the United States that year will be used and the time will be 2 AM. If the start and end dates are provided but the time is not provided, the time will be midnight.
Note that in most installations, TZ is set to the correct value by default when the user logs on, via the local /etc/profile file (see profile(M)).
The Wn.[d] format for defining the start and end dates of daylight savings time in the TZ environment variable is not recognized by tzset(S). To work around this limitation, use one of the other formats, such as Mm.n.d, to set the limits of DST in TZ.