timezone(4)
NAME
timezone − set default system time zone
SYNOPSIS
/etc/TIMEZONE
DESCRIPTION
This file sets and exports the time zone environmental variable TZ.
This file is “dotted” into other files that must know the time zone.
The syntax of TZ can be described as follows:
TZ → zone
| zone signed_time
| zone signed_time zone
| zone signed_time zone dst
| : pathname
zone→ letter letter letter
signed_time→ sign time
| time
time→ hour
| hour : minute
| hour : minute : second
dst→ signed_time
| signed_time ; dst_date , dst_date
| ; dst_date , dst_date
dst_date→ julian
| julian / time
letter → a | A | b | B | ... | z | Z
hour → 00 | 01 | ... | 23
minute→ 00 | 01 | ... | 59
second→ 00 | 01 | ... | 59
julian→ 001 | 002 | ...| 366
sign→ − | +
EXAMPLES
The contents of /etc/TIMEZONE corresponding to the simple example below could be
#Time Zone
TZ=EST5EDT
export TZ
A simple setting for New Jersey could be
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;116/2:00:00,298/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, 116 is the number of the day of the year (using zero-based Julian days) 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, 298 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;63/5:00,302/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.
If the pathname format is used, the pathname is the name of a compiled time zone information file (see zic(1M)). The compiled files contain the equivalent time zone information.
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(4)).
NOTES
When the longer format is used, the TZ variable must be surrounded by double quotes as shown.
The system administrator must change the Julian start and end days annually if the longer form of the TZ variable is used.
Setting the time during the interval of change from the main time zone to the alternate time zone or vice versa can produce unpredictable results.
The “:pathname” format is an implementation-defined extension provided by many but not necessarily all UNIX implementations. It is a more flexible mechanism for complicated time zone rules, but is likely to be slower for the most usual cases.
SEE ALSO
profile(4), environ(5).
ctime(3C) in the CX/UX Programmer’s Reference Manual.
zic(1M) in the CX/UX Administrator’s Reference Manual.
CX/UX Programmer’s Reference Manual