version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
TZSET |
|
|
2 |
!!!TZSET |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
FILES |
|
|
7 |
CONFORMING TO |
|
|
8 |
SEE ALSO |
|
|
9 |
---- |
|
|
10 |
!!NAME |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
tzset - initialize time conversion information |
|
|
14 |
!!SYNOPSIS |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
__#include |
|
|
18 |
__''tzname''__[[2] |
|
|
19 |
__ |
|
|
20 |
!!DESCRIPTION |
|
|
21 |
|
|
|
22 |
|
|
|
23 |
The __tzset()__ function initializes the ''tzname'' |
|
|
24 |
variable from the TZ environment variable. This function is |
|
|
25 |
automatically called by the other time conversion functions |
|
|
26 |
that depend on the time zone. |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
If the TZ variable does not appear in the environment, the |
|
|
30 |
''tzname'' variable is initialized with the best |
|
|
31 |
approximation of local wall clock time, as specified by the |
|
|
32 |
tzfile(5)-format file ''localtime'' found in the |
|
|
33 |
system timezone directory (see below). (One also often sees |
|
|
34 |
''/etc/localtime'' used here, a symlink to the right file |
|
|
35 |
in the system timezone directory.) |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
If the TZ variable does appear in the environment but its |
|
|
39 |
value is NULL or its value cannot be interpreted using any |
|
|
40 |
of the formats specified below, Coordinated Universal Time |
|
|
41 |
(UTC) is used. |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
The value of TZ can be one of three formats. The first |
|
|
45 |
format is used when there is no daylight saving time in the |
|
|
46 |
local time zone: |
|
|
47 |
|
|
|
48 |
|
|
|
49 |
''std offset'' |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
The ''std'' string specifies the name of the time zone |
|
|
53 |
and must be three or more alphabetic characters. The |
|
|
54 |
''offset'' string immediately follows ''std'' and |
|
|
55 |
specifies the time value to be added to the local time to |
|
|
56 |
get Coordinated Universal Time (UTC). The ''offset'' is |
|
|
57 |
positive if the local time zone is west of the Prime |
|
|
58 |
Meridian and negative if it is east. The hour must be |
|
|
59 |
between 0 and 24, and the minutes and seconds 0 and |
|
|
60 |
59. |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
The second format is used when there is daylight saving |
|
|
64 |
time: |
|
|
65 |
|
|
|
66 |
|
|
|
67 |
''std offset dst |
|
|
68 |
[[offset],start[[/time],end[[/time]'' |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
There are no spaces in the specification. The initial |
|
|
72 |
''std'' and ''offset'' specify the standard time zone, |
|
|
73 |
as described above. The ''dst'' string and ''offset'' |
|
|
74 |
specify the name and offset for the corresponding daylight |
|
|
75 |
savings time zone. If the offset is omitted, it defaults to |
|
|
76 |
one hour ahead of standard time. |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
The ''start'' field specifies when daylight savings time |
|
|
80 |
goes into effect and the ''end'' field specifies when the |
|
|
81 |
change is made back to standard time. These fields may have |
|
|
82 |
the following formats: |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
J''n'' |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
This specifies the Julian day with ''n'' between 1 and |
|
|
89 |
365. February 29 is never counted even in leap |
|
|
90 |
years. |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
''n'' |
|
|
94 |
|
|
|
95 |
|
|
|
96 |
This specifies the Julian day with ''n'' between 1 and |
|
|
97 |
365. February 29 is counted in leap years. |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
M''m''.''w''.''d'' |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
This specifies day ''d'' (0 ''d'' |
|
|
104 |
''w'' (1 ''w'' ''m'' |
|
|
105 |
(1 ''m'' |
|
|
106 |
''d'' occurs and week 5 is the last week in |
|
|
107 |
which day ''d'' occurs. Day 0 is a Sunday. |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
The ''time'' fields specify when, in the local time |
|
|
111 |
currently in effect, the change to the other time occurs. If |
|
|
112 |
omitted, the default is 02:00:00. |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
The third format specifies that the time zone information |
|
|
116 |
should be read from a file: |
|
|
117 |
|
|
|
118 |
|
|
|
119 |
:[[filespec] |
|
|
120 |
|
|
|
121 |
|
|
|
122 |
If the file specification ''filespec'' is omitted, the |
|
|
123 |
time zone information is read from the file ''localtime'' |
|
|
124 |
in the system timezone directory, which nowadays usually is |
|
|
125 |
''/usr/share/zoneinfo''. This file is in tzfile(5) |
|
|
126 |
format. If ''filespec'' is given, it specifies another |
|
|
127 |
tzfile(5)-format file to read the time zone |
|
|
128 |
information from. If ''filespec'' does not begin with a |
|
|
129 |
`/', the file specification is relative to the system |
|
|
130 |
timezone directory. |
|
|
131 |
!!FILES |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
The system time zone directory used depends on the (g)libc |
|
|
135 |
version. Libc4 and libc5 use ''/usr/lib/zoneinfo'', and, |
|
|
136 |
since libc-5.4.6, when this doesn't work, will try |
|
|
137 |
''/usr/share/zoneinfo''. Glibc2 will use the environment |
|
|
138 |
variable TZDIR, when that exists. Its default depends on how |
|
|
139 |
it was installed, but normally is |
|
|
140 |
''/usr/share/zoneinfo''. |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
This timezone directory contains the files |
|
|
144 |
|
|
|
145 |
|
|
|
146 |
localtime local time zone file |
|
|
147 |
posixrules rules for POSIX-style TZ's |
|
|
148 |
Often ''/etc/localtime'' is a symlink to the file ''localtime'' or to the correct time zone file in the system time zone directory. |
|
|
149 |
!!CONFORMING TO |
|
|
150 |
|
|
|
151 |
|
|
|
152 |
SVID 3, POSIX, BSD 4.3 |
|
|
153 |
!!SEE ALSO |
|
|
154 |
|
|
|
155 |
|
|
|
156 |
date(1), gettimeofday(2), time(2), |
|
|
157 |
ctime(3), getenv(3), |
|
|
158 |
tzfile(5) |
|
|
159 |
---- |