1TZSET(3P) POSIX Programmer's Manual TZSET(3P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 daylight, timezone, tzname, tzset - set timezone conversion information
13
15 #include <time.h>
16
17
18
19 extern int daylight;
20 extern long timezone;
21
22
23 extern char *tzname[2];
24 void tzset(void);
25
26
28 The tzset() function shall use the value of the environment variable TZ
29 to set time conversion information used by ctime(), localtime(),
30 mktime(), and strftime() . If TZ is absent from the environment, imple‐
31 mentation-defined default timezone information shall be used.
32
33 The tzset() function shall set the external variable tzname as follows:
34
35
36 tzname[0] = "std";
37 tzname[1] = "dst";
38
39 where std and dst are as described in the Base Definitions volume of
40 IEEE Std 1003.1-2001, Chapter 8, Environment Variables.
41
42 The tzset() function also shall set the external variable daylight to 0
43 if Daylight Savings Time conversions should never be applied for the
44 timezone in use; otherwise, non-zero. The external variable timezone
45 shall be set to the difference, in seconds, between Coordinated Univer‐
46 sal Time (UTC) and local standard time.
47
49 The tzset() function shall not return a value.
50
52 No errors are defined.
53
54 The following sections are informative.
55
57 Example TZ variables and their timezone differences are given in the
58 table below:
59
60 TZ timezone
61 EST5EDT 5*60*60
62 GMT0 0*60*60
63 JST-9 -9*60*60
64 MET-1MEST -1*60*60
65 MST7MDT 7*60*60
66
67 PST8PDT 8*60*60
68
70 None.
71
73 None.
74
76 None.
77
79 ctime(), localtime(), mktime(), strftime(), the Base Definitions volume
80 of IEEE Std 1003.1-2001, Chapter 8, Environment Variables, <time.h>
81
83 Portions of this text are reprinted and reproduced in electronic form
84 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
85 -- Portable Operating System Interface (POSIX), The Open Group Base
86 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
87 Electrical and Electronics Engineers, Inc and The Open Group. In the
88 event of any discrepancy between this version and the original IEEE and
89 The Open Group Standard, the original IEEE and The Open Group Standard
90 is the referee document. The original Standard can be obtained online
91 at http://www.opengroup.org/unix/online.html .
92
93
94
95IEEE/The Open Group 2003 TZSET(3P)