1 | .TH TZ 5
|
---|
2 | .SH NAME
|
---|
3 | TZ \- Time zone environment variable
|
---|
4 | .SH SYNOPSIS
|
---|
5 | \fBTZ=\fIzone\fR[\fB\-\fR]\fIoffset\fR[\fIdst\fR[\fIoffset\fR][\fB,\fIstart\fR[\fB/\fItime\fR]\fB,\fIend\fR[\fB/\fItime\fR]]]
|
---|
6 | .SH DESCRIPTION
|
---|
7 | .de SP
|
---|
8 | .if t .sp 0.4
|
---|
9 | .if n .sp
|
---|
10 | ..
|
---|
11 | The
|
---|
12 | .B TZ
|
---|
13 | environment variable tells functions such as the
|
---|
14 | .BR ctime (3)
|
---|
15 | family and programs like
|
---|
16 | .B date
|
---|
17 | what the time zone and daylight saving rule is. The value of
|
---|
18 | .B TZ
|
---|
19 | has the \s-2POSIX\s+2 standardized form shown in the synopsis. This form
|
---|
20 | specifies the zone names, offsets from GMT, and daylight saving changeover
|
---|
21 | times for at least the current year.
|
---|
22 | .TP
|
---|
23 | .I zone
|
---|
24 | A three or more letter name for the time zone in normal (winter) time.
|
---|
25 | .TP
|
---|
26 | .BI [\-] offset
|
---|
27 | A signed time telling the offset of the time zone westwards from Greenwich.
|
---|
28 | The time has the form
|
---|
29 | .I hh[:mm[:ss]]
|
---|
30 | with a one of two digit hour, and optional two digit minutes and seconds.
|
---|
31 | .TP
|
---|
32 | .I dst
|
---|
33 | The name of the time zone when daylight saving is in effect. It may
|
---|
34 | be followed by an offset telling how big the clock correction is other than
|
---|
35 | the default of 1 hour.
|
---|
36 | .TP
|
---|
37 | \fIstart\fR/\fItime\fR,\fIend\fR/\fItime\fR
|
---|
38 | Specifies the start and end of the daylight saving period. The
|
---|
39 | .I start
|
---|
40 | and
|
---|
41 | .I end
|
---|
42 | fields indicate on what day the changeover occurs. They must be in one of
|
---|
43 | the following formats:
|
---|
44 | .SP
|
---|
45 | .ta +5
|
---|
46 | .in +5
|
---|
47 | .ti -5
|
---|
48 | \fBJ\fIn\fR The Julian day
|
---|
49 | .I n
|
---|
50 | (1 <=
|
---|
51 | .I n
|
---|
52 | <= 365) ignoring leap days, i.e. there is no February 29.
|
---|
53 | .SP
|
---|
54 | .ti -5
|
---|
55 | \fIn\fR The zero-based Julian day
|
---|
56 | (0 <=
|
---|
57 | .I n
|
---|
58 | <= 365). Leap days are not ignored.
|
---|
59 | .SP
|
---|
60 | .ti -5
|
---|
61 | .BI M m . n . d
|
---|
62 | .br
|
---|
63 | This indicates month
|
---|
64 | .IR m ,
|
---|
65 | the
|
---|
66 | .IR n -th
|
---|
67 | occurrence of day
|
---|
68 | .I d
|
---|
69 | (1 <=
|
---|
70 | .I m
|
---|
71 | <= 12, 1 <=
|
---|
72 | .I n
|
---|
73 | <= 5, 0 <=
|
---|
74 | .I d
|
---|
75 | <= 6, 0=Sunday). The 5-th occurrence means the last occurrence of that day
|
---|
76 | in a month. So
|
---|
77 | .B M4.1.0
|
---|
78 | is the first Sunday in April,
|
---|
79 | .B M9.5.0
|
---|
80 | is the last Sunday in September.
|
---|
81 | .in -5
|
---|
82 | .SP
|
---|
83 | The
|
---|
84 | .I time
|
---|
85 | field indicates the time the changeover occurs on the given day.
|
---|
86 | .SH EXAMPLES
|
---|
87 | Greenwich Mean Time:
|
---|
88 | .PP
|
---|
89 | .RS
|
---|
90 | .B TZ=GMT0
|
---|
91 | .RE
|
---|
92 | .PP
|
---|
93 | Central European Time, 1 hour east from Greenwich, daylight saving starts on
|
---|
94 | the last Sunday in March at 2 AM and ends on the last Sunday in October
|
---|
95 | at 3 AM:
|
---|
96 | .PP
|
---|
97 | .RS
|
---|
98 | .B TZ='CET\-1CEST,M3.5.0/2,M10.5.0/3'
|
---|
99 | .RE
|
---|
100 | .PP
|
---|
101 | British time, daylight saving starts and ends at the same moment as CET,
|
---|
102 | but in an earlier time zone:
|
---|
103 | .PP
|
---|
104 | .RS
|
---|
105 | .B TZ=GMT0BST,M3.5.0/1,M10.5.0/2
|
---|
106 | .RE
|
---|
107 | .PP
|
---|
108 | The eastern european time zones also have the changeovers at the same
|
---|
109 | absolute time as British time and CET.
|
---|
110 | .PP
|
---|
111 | U.S. Eastern Standard Time, 5 hours west from Greenwich, daylight saving
|
---|
112 | starts on the first Sunday in April at 2 AM and ends on the last Sunday in
|
---|
113 | October at 2 AM:
|
---|
114 | .PP
|
---|
115 | .RS
|
---|
116 | .B TZ=EST5EDT,M4.1.0/2,M10.5.0/2
|
---|
117 | .RE
|
---|
118 | .PP
|
---|
119 | It shouldn't surprise you that daylight saving in New Zealand is observed
|
---|
120 | in the months opposite from the previous examples. It starts on the first
|
---|
121 | Sunday in October at 2 AM and ends on the third Sunday in March at 3 AM:
|
---|
122 | .PP
|
---|
123 | .RS
|
---|
124 | .B TZ=NZST\-12NZDT,M10.1.0/2,M3.3.0/3
|
---|
125 | .RE
|
---|
126 | .SH "SEE ALSO"
|
---|
127 | .BR readclock (8),
|
---|
128 | .BR date (1).
|
---|
129 | .SH BUGS
|
---|
130 | You may have noticed that many fields are optional. Do no omit them,
|
---|
131 | because the defaults are bogus. If you need daylight saving then fully
|
---|
132 | specify the changeovers.
|
---|
133 | .PP
|
---|
134 | West is negative, east is positive, ask any sailor.
|
---|
135 | .PP
|
---|
136 | Next year's time zone and daylight saving time are determined by politicians.
|
---|
137 | .SH AUTHOR
|
---|
138 | Kees J. Bot (kjb@cs.vu.nl)
|
---|