mirror of https://github.com/mkerrisk/man-pages
parent
6cd29063da
commit
e2905dc1b1
38
man3/tzset.3
38
man3/tzset.3
|
@ -47,8 +47,8 @@ TZ environment variable. This function is automatically called by the
|
|||
other time conversion functions that depend on the time zone.
|
||||
In a SysV-like environment it will also set the variables \fItimezone\fP
|
||||
(seconds West of GMT) and \fIdaylight\fP (0 if this time zone does not
|
||||
have any daylight savings time rules, non-zero if there is a time during
|
||||
the year when daylight savings time applies).
|
||||
have any daylight saving time rules, non-zero if there is a time during
|
||||
the year when daylight saving time applies).
|
||||
.PP
|
||||
If the TZ variable does not appear in the environment, the \fItzname\fP
|
||||
variable is initialized with the best approximation of local wall clock
|
||||
|
@ -85,13 +85,15 @@ The second format is used when there is daylight saving time:
|
|||
.I std offset dst [offset],start[/time],end[/time]
|
||||
.RE
|
||||
.sp
|
||||
There are no spaces in the specification. The initial \fIstd\fP and
|
||||
\fIoffset\fP specify the standard time zone, as described above. The
|
||||
\fIdst\fP string and \fIoffset\fP specify the name and offset for the
|
||||
corresponding daylight savings time zone. If the offset is omitted,
|
||||
it defaults to one hour ahead of standard time.
|
||||
There are no spaces in the specification.
|
||||
The initial \fIstd\fP and
|
||||
\fIoffset\fP specify the standard time zone, as described above.
|
||||
The \fIdst\fP string and \fIoffset\fP specify the name and offset for the
|
||||
corresponding daylight saving time zone.
|
||||
If the offset is omitted,
|
||||
it default to one hour ahead of standard time.
|
||||
.PP
|
||||
The \fIstart\fP field specifies when daylight savings time goes into
|
||||
The \fIstart\fP field specifies when daylight saving time goes into
|
||||
effect and the \fIend\fP field specifies when the change is made back to
|
||||
standard time. These fields may have the following formats:
|
||||
.TP
|
||||
|
@ -111,6 +113,16 @@ in which day \fId\fP occurs. Day 0 is a Sunday.
|
|||
.PP
|
||||
The \fItime\fP fields specify when, in the local time currently in effect,
|
||||
the change to the other time occurs. If omitted, the default is 02:00:00.
|
||||
|
||||
Here is an example for New Zealand,
|
||||
where the standard time (NZST) is 12 hours ahead of UTC,
|
||||
and daylight saving time (NZDT), 13 hours ahead of UTC,
|
||||
runs from the first Sunday in October to the third Sunday in March,
|
||||
and the changeovers happen at the default time of 02:00:00:
|
||||
.nf
|
||||
|
||||
TZ="NZST-12.00:00NZDT-13:00:00,M10.1.0,M3.3.0"
|
||||
.fi
|
||||
.PP
|
||||
The third format specifies that the time zone information should be read
|
||||
from a file:
|
||||
|
@ -131,6 +143,12 @@ format. If \fIfilespec\fP is given, it specifies another
|
|||
file to read the time zone information from. If
|
||||
\fIfilespec\fP does not begin with a `/', the file specification is
|
||||
relative to the system timezone directory.
|
||||
.PP
|
||||
Here's an example, once more for New Zealand:
|
||||
.nf
|
||||
|
||||
TZ=":Pacific/Auckland"
|
||||
.fi
|
||||
.SH FILES
|
||||
The system time zone directory used depends on the (g)libc version.
|
||||
Libc4 and libc5 use
|
||||
|
@ -157,7 +175,7 @@ or to the correct time zone file in the system time zone directory.
|
|||
SVr4, POSIX.1-2001, 4.3BSD
|
||||
.SH NOTES
|
||||
Note that the variable \fIdaylight\fP does not indicate that daylight
|
||||
savings time applies right now. It used to give the number of some
|
||||
saving time applies right now. It used to give the number of some
|
||||
algorithm (see the variable \fItz_dsttime\fP in
|
||||
.BR gettimeofday (2)).
|
||||
It has been obsolete for many years but is required by SUSv2.
|
||||
|
@ -167,7 +185,7 @@ It has been obsolete for many years but is required by SUSv2.
|
|||
that returned the
|
||||
name of the time zone corresponding to its first argument (minutes
|
||||
West of GMT). If the second argument was 0, the standard name was used,
|
||||
otherwise the daylight savings time version.
|
||||
otherwise the daylight saving time version.
|
||||
.SH "SEE ALSO"
|
||||
.BR date (1),
|
||||
.BR gettimeofday (2),
|
||||
|
|
Loading…
Reference in New Issue