logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

tzset.3p (3886B)


  1. '\" et
  2. .TH TZSET "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. daylight,
  12. timezone,
  13. tzname,
  14. tzset
  15. \(em set timezone conversion information
  16. .SH SYNOPSIS
  17. .LP
  18. .nf
  19. #include <time.h>
  20. .P
  21. extern int daylight;
  22. extern long timezone;
  23. extern char *tzname[2];
  24. void tzset(void);
  25. .fi
  26. .SH DESCRIPTION
  27. The
  28. \fItzset\fR()
  29. function shall use the value of the environment variable
  30. .IR TZ
  31. to set time conversion information used by
  32. .IR "\fIctime\fR\^(\|)",
  33. .IR "\fIlocaltime\fR\^(\|)",
  34. .IR "\fImktime\fR\^(\|)",
  35. and
  36. .IR "\fIstrftime\fR\^(\|)".
  37. If
  38. .IR TZ
  39. is absent from the environment, implementation-defined default
  40. timezone information shall be used.
  41. .P
  42. The
  43. \fItzset\fR()
  44. function shall set the external variable
  45. .IR tzname
  46. as follows:
  47. .sp
  48. .RS 4
  49. .nf
  50. tzname[0] = "\fIstd\fP";
  51. tzname[1] = "\fIdst\fP";
  52. .fi
  53. .P
  54. .RE
  55. .P
  56. where
  57. .IR std
  58. and
  59. .IR dst
  60. are as described in the Base Definitions volume of POSIX.1\(hy2017,
  61. .IR "Chapter 8" ", " "Environment Variables".
  62. .P
  63. The
  64. \fItzset\fR()
  65. function also shall set the external variable
  66. .IR daylight
  67. to 0 if Daylight Savings Time conversions should never be applied for
  68. the timezone in use; otherwise, non-zero. The external variable
  69. .IR timezone
  70. shall be set to the difference, in seconds, between Coordinated
  71. Universal Time (UTC) and local standard time.
  72. .P
  73. If a thread accesses
  74. .IR tzname ,
  75. .IR daylight ,
  76. or
  77. .IR timezone
  78. directly while another thread is in a call to
  79. \fItzset\fR(),
  80. or to any function that is required or allowed to set timezone
  81. information as if by calling
  82. \fItzset\fR(),
  83. the behavior is undefined.
  84. .SH "RETURN VALUE"
  85. The
  86. \fItzset\fR()
  87. function shall not return a value.
  88. .SH ERRORS
  89. No errors are defined.
  90. .LP
  91. .IR "The following sections are informative."
  92. .SH EXAMPLES
  93. Example
  94. .IR TZ
  95. variables and their timezone differences are given in the table below:
  96. .TS
  97. center box tab(!);
  98. cI | cI
  99. lw(1i) | lw(1i).
  100. TZ!timezone
  101. _
  102. EST5EDT!5*60*60
  103. GMT0!0*60*60
  104. JST-9!\-9*60*60
  105. MET-1MEST!\-1*60*60
  106. MST7MDT!7*60*60
  107. PST8PDT!8*60*60
  108. .TE
  109. .SH "APPLICATION USAGE"
  110. Since the
  111. \fIctime\fR(),
  112. \fIlocaltime\fR(),
  113. \fImktime\fR(),
  114. \fIstrftime\fR(),
  115. and
  116. \fIstrftime_l\fR()
  117. functions are required to set timezone information as if by calling
  118. \fItzset\fR(),
  119. there is no need for an explicit
  120. \fItzset\fR()
  121. call before using these functions. However, portable applications
  122. should call
  123. \fItzset\fR()
  124. explicitly before using
  125. \fIctime_r\fR()
  126. or
  127. \fIlocaltime_r\fR()
  128. because setting timezone information is optional for those functions.
  129. .SH RATIONALE
  130. None.
  131. .SH "FUTURE DIRECTIONS"
  132. None.
  133. .SH "SEE ALSO"
  134. .IR "\fIctime\fR\^(\|)",
  135. .IR "\fIlocaltime\fR\^(\|)",
  136. .IR "\fImktime\fR\^(\|)",
  137. .IR "\fIstrftime\fR\^(\|)"
  138. .P
  139. The Base Definitions volume of POSIX.1\(hy2017,
  140. .IR "Chapter 8" ", " "Environment Variables",
  141. .IR "\fB<time.h>\fP"
  142. .\"
  143. .SH COPYRIGHT
  144. Portions of this text are reprinted and reproduced in electronic form
  145. from IEEE Std 1003.1-2017, Standard for Information Technology
  146. -- Portable Operating System Interface (POSIX), The Open Group Base
  147. Specifications Issue 7, 2018 Edition,
  148. Copyright (C) 2018 by the Institute of
  149. Electrical and Electronics Engineers, Inc and The Open Group.
  150. In the event of any discrepancy between this version and the original IEEE and
  151. The Open Group Standard, the original IEEE and The Open Group Standard
  152. is the referee document. The original Standard can be obtained online at
  153. http://www.opengroup.org/unix/online.html .
  154. .PP
  155. Any typographical or formatting errors that appear
  156. in this page are most likely
  157. to have been introduced during the conversion of the source files to
  158. man page format. To report such errors, see
  159. https://www.kernel.org/doc/man-pages/reporting_bugs.html .