您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

124 行
5.3KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <title>tzset (The Red Hat newlib C Library)</title>
  7. <meta name="description" content="tzset (The Red Hat newlib C Library)">
  8. <meta name="keywords" content="tzset (The Red Hat newlib C Library)">
  9. <meta name="resource-type" content="document">
  10. <meta name="distribution" content="global">
  11. <meta name="Generator" content="makeinfo">
  12. <link href="index.html#Top" rel="start" title="Top">
  13. <link href="Document-Index.html#Document-Index" rel="index" title="Document Index">
  14. <link href="Document-Index.html#SEC_Contents" rel="contents" title="Table of Contents">
  15. <link href="Timefns.html#Timefns" rel="up" title="Timefns">
  16. <link href="Locale.html#Locale" rel="next" title="Locale">
  17. <link href="_005f_005ftz_005flock.html#g_t_005f_005ftz_005flock" rel="prev" title="__tz_lock">
  18. <style type="text/css">
  19. <!--
  20. a.summary-letter {text-decoration: none}
  21. blockquote.indentedblock {margin-right: 0em}
  22. blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
  23. blockquote.smallquotation {font-size: smaller}
  24. div.display {margin-left: 3.2em}
  25. div.example {margin-left: 3.2em}
  26. div.lisp {margin-left: 3.2em}
  27. div.smalldisplay {margin-left: 3.2em}
  28. div.smallexample {margin-left: 3.2em}
  29. div.smalllisp {margin-left: 3.2em}
  30. kbd {font-style: oblique}
  31. pre.display {font-family: inherit}
  32. pre.format {font-family: inherit}
  33. pre.menu-comment {font-family: serif}
  34. pre.menu-preformatted {font-family: serif}
  35. pre.smalldisplay {font-family: inherit; font-size: smaller}
  36. pre.smallexample {font-size: smaller}
  37. pre.smallformat {font-family: inherit; font-size: smaller}
  38. pre.smalllisp {font-size: smaller}
  39. span.nolinebreak {white-space: nowrap}
  40. span.roman {font-family: initial; font-weight: normal}
  41. span.sansserif {font-family: sans-serif; font-weight: normal}
  42. ul.no-bullet {list-style: none}
  43. -->
  44. </style>
  45. </head>
  46. <body lang="en">
  47. <a name="tzset"></a>
  48. <div class="header">
  49. <p>
  50. Previous: <a href="_005f_005ftz_005flock.html#g_t_005f_005ftz_005flock" accesskey="p" rel="prev">__tz_lock</a>, Up: <a href="Timefns.html#Timefns" accesskey="u" rel="up">Timefns</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  51. </div>
  52. <hr>
  53. <a name="tzset_002d_002d_002dset-timezone-characteristics-from-TZ-environment-variable"></a>
  54. <h3 class="section">8.11 <code>tzset</code>&mdash;set timezone characteristics from TZ environment variable</h3>
  55. <a name="index-tzset"></a>
  56. <a name="index-_005ftzset_005fr"></a>
  57. <p><strong>Synopsis</strong>
  58. </p><div class="example">
  59. <pre class="example">#include &lt;time.h&gt;
  60. void tzset(void);
  61. void _tzset_r (struct _reent *<var>reent_ptr</var>);
  62. </pre></div>
  63. <p><strong>Description</strong><br>
  64. <code>tzset</code> examines the TZ environment variable and sets up the three
  65. external variables: <code>_timezone</code>, <code>_daylight</code>, and <code>tzname</code>. The
  66. value of <code>_timezone</code> shall be the offset from the current time zone
  67. to GMT. The value of <code>_daylight</code> shall be 0 if there is no daylight
  68. savings time for the current time zone, otherwise it will be non-zero.
  69. The <code>tzname</code> array has two entries: the first is the name of the
  70. standard time zone, the second is the name of the daylight-savings time
  71. zone.
  72. </p>
  73. <p>The TZ environment variable is expected to be in the following POSIX
  74. format:
  75. </p>
  76. <p>stdoffset1[dst[offset2][,start[/time1],end[/time2]]]
  77. </p>
  78. <p>where: std is the name of the standard time-zone (minimum 3 chars)
  79. offset1 is the value to add to local time to arrive at Universal time
  80. it has the form: hh[:mm[:ss]]
  81. dst is the name of the alternate (daylight-savings) time-zone (min 3 chars)
  82. offset2 is the value to add to local time to arrive at Universal time
  83. it has the same format as the std offset
  84. start is the day that the alternate time-zone starts
  85. time1 is the optional time that the alternate time-zone starts
  86. (this is in local time and defaults to 02:00:00 if not specified)
  87. end is the day that the alternate time-zone ends
  88. time2 is the time that the alternate time-zone ends
  89. (it is in local time and defaults to 02:00:00 if not specified)
  90. </p>
  91. <p>Note that there is no white-space padding between fields. Also note that
  92. if TZ is null, the default is Universal GMT which has no daylight-savings
  93. time. If TZ is empty, the default EST5EDT is used.
  94. </p>
  95. <p>The function <code>_tzset_r</code> is identical to <code>tzset</code> only it is reentrant
  96. and is used for applications that use multiple threads.
  97. </p>
  98. <br>
  99. <p><strong>Returns</strong><br>
  100. There is no return value.
  101. </p>
  102. <br>
  103. <p><strong>Portability</strong><br>
  104. <code>tzset</code> is part of the POSIX standard.
  105. </p>
  106. <p>Supporting OS subroutine required: None
  107. </p>
  108. <br>
  109. <hr>
  110. <div class="header">
  111. <p>
  112. Previous: <a href="_005f_005ftz_005flock.html#g_t_005f_005ftz_005flock" accesskey="p" rel="prev">__tz_lock</a>, Up: <a href="Timefns.html#Timefns" accesskey="u" rel="up">Timefns</a> &nbsp; [<a href="Document-Index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Document-Index.html#Document-Index" title="Index" rel="index">Index</a>]</p>
  113. </div>
  114. </body>
  115. </html>