1TZSET(3P)                  POSIX Programmer's Manual                 TZSET(3P)
2
3
4

PROLOG

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
11

NAME

13       daylight, timezone, tzname, tzset — set timezone conversion information
14

SYNOPSIS

16       #include <time.h>
17
18       extern int daylight;
19       extern long timezone;
20       extern char *tzname[2];
21       void tzset(void);
22

DESCRIPTION

24       The tzset() function shall use the value of the environment variable TZ
25       to  set  time  conversion  information  used  by  ctime(), localtime(),
26       mktime(), and strftime().  If TZ is absent from the environment, imple‐
27       mentation-defined default timezone information shall be used.
28
29       The tzset() function shall set the external variable tzname as follows:
30
31           tzname[0] = "std";
32           tzname[1] = "dst";
33
34       where  std  and  dst are as described in the Base Definitions volume of
35       POSIX.1‐2008, Chapter 8, Environment Variables.
36
37       The tzset() function also shall set the external variable daylight to 0
38       if  Daylight  Savings  Time conversions should never be applied for the
39       timezone in use; otherwise, non-zero. The  external  variable  timezone
40       shall be set to the difference, in seconds, between Coordinated Univer‐
41       sal Time (UTC) and local standard time.
42

RETURN VALUE

44       The tzset() function shall not return a value.
45

ERRORS

47       No errors are defined.
48
49       The following sections are informative.
50

EXAMPLES

52       Example TZ variables and their timezone differences are  given  in  the
53       table below:
54
55                              ┌───────────┬────────────┐
56TZtimezone
57                              ├───────────┼────────────┤
58                              │EST5EDT    │ 5*60*60    │
59                              │GMT0       │ 0*60*60    │
60                              │JST-9      │ −9*60*60   │
61                              │MET-1MEST  │ −1*60*60   │
62                              │MST7MDT    │ 7*60*60    │
63                              │PST8PDT    │ 8*60*60    │
64                              └───────────┴────────────┘

APPLICATION USAGE

66       None.
67

RATIONALE

69       None.
70

FUTURE DIRECTIONS

72       None.
73

SEE ALSO

75       ctime(), localtime(), mktime(), strftime()
76
77       The  Base  Definitions  volume  of POSIX.1‐2008, Chapter 8, Environment
78       Variables, <time.h>
79
81       Portions of this text are reprinted and reproduced in  electronic  form
82       from IEEE Std 1003.1, 2013 Edition, Standard for Information Technology
83       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
84       Specifications Issue 7, Copyright (C) 2013 by the Institute of Electri‐
85       cal and Electronics Engineers,  Inc  and  The  Open  Group.   (This  is
86       POSIX.1-2008  with  the  2013  Technical Corrigendum 1 applied.) In the
87       event of any discrepancy between this version and the original IEEE and
88       The  Open Group Standard, the original IEEE and The Open Group Standard
89       is the referee document. The original Standard can be  obtained  online
90       at http://www.unix.org/online.html .
91
92       Any  typographical  or  formatting  errors that appear in this page are
93       most likely to have been introduced during the conversion of the source
94       files  to  man page format. To report such errors, see https://www.ker
95       nel.org/doc/man-pages/reporting_bugs.html .
96
97
98
99IEEE/The Open Group                  2013                            TZSET(3P)
Impressum