📄 time.h.html
字号:
struct tm *gmtime_r(const time_t *restrict, struct tm *restrict);<img src="../images/opt-end.gif" alt="[Option End]" border="0">struct tm *localtime(const time_t *);<sup>[<a href="javascript:open_code('TSF')">TSF</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">struct tm *localtime_r(const time_t *restrict, struct tm *restrict);<img src="../images/opt-end.gif" alt="[Option End]" border="0">time_t mktime(struct tm *);<sup>[<a href="javascript:open_code('TMR')">TMR</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">int nanosleep(const struct timespec *, struct timespec *);<img src="../images/opt-end.gif" alt="[Option End]" border="0">size_t strftime(char *restrict, size_t, const char *restrict, const struct tm *restrict);<sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">char *strptime(const char *restrict, const char *restrict, struct tm *restrict);<img src="../images/opt-end.gif" alt="[Option End]" border="0">time_t time(time_t *);<sup>[<a href="javascript:open_code('TMR')">TMR</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">int timer_create(clockid_t, struct sigevent *restrict, timer_t *restrict);int timer_delete(timer_t);int timer_gettime(timer_t, struct itimerspec *);int timer_getoverrun(timer_t);int timer_settime(timer_t, int, const struct itimerspec *restrict, struct itimerspec *restrict);<img src="../images/opt-end.gif" alt="[Option End]" border="0"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">void tzset(void);<img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></pre><br><p>The following shall be declared as variables:</p><pre><tt><sup>[<a href="javascript:open_code('XSI')">XSI</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">extern int daylight;extern long timezone;<img src="../images/opt-end.gif" alt="[Option End]" border="0"><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup><img src="../images/opt-start.gif" alt="[Option Start]" border="0">extern char *tzname[];<img src="../images/opt-end.gif" alt="[Option End]" border="0"></tt></pre><p><sup>[<a href="javascript:open_code('CX')">CX</a>]</sup> <img src="../images/opt-start.gif" alt="[Option Start]" border="0">Inclusion of the <i><time.h></i> header may make visible all symbols from the <a href="../basedefs/signal.h.html"><i><signal.h></i></a> header. <img src="../images/opt-end.gif" alt="[Option End]" border="0"></p></blockquote><hr><div class="box"><em>The following sections are informative.</em></div><h4><a name="tag_13_76_04"></a>APPLICATION USAGE</h4><blockquote><p>The range [0,60] for <i>tm_sec</i> allows for the occasional leap second.</p><p><i>tm_year</i> is a signed value; therefore, years before 1900 may be represented.</p><p>To obtain the number of clock ticks per second returned by the <a href="../functions/times.html"><i>times</i>()</a> function,applications should call <i>sysconf</i>(_SC_CLK_TCK).</p></blockquote><h4><a name="tag_13_76_05"></a>RATIONALE</h4><blockquote><p>The range [0,60] seconds allows for positive or negative leap seconds. The formal definition of UTC does not permit double leapseconds, so all mention of double leap seconds has been removed, and the range shortened from the former [0,61] seconds seen inprevious versions of POSIX.</p></blockquote><h4><a name="tag_13_76_06"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_13_76_07"></a>SEE ALSO</h4><blockquote><p><a href="signal.h.html"><i><signal.h></i></a> , <a href="sys/types.h.html"><i><sys/types.h></i></a> , the SystemInterfaces volume of IEEE Std 1003.1-2001, <a href="../functions/asctime.html"><i>asctime</i>()</a>, <a href="../functions/clock.html"><i>clock</i>()</a>, <a href="../functions/clock_getcpuclockid.html"><i>clock_getcpuclockid</i>()</a>, <ahref="../functions/clock_getres.html"><i>clock_getres</i>()</a>, <a href="../functions/clock_nanosleep.html"><i>clock_nanosleep</i>()</a>, <a href="../functions/ctime.html"><i>ctime</i>()</a>, <a href="../functions/difftime.html"><i>difftime</i>()</a>, <a href="../functions/getdate.html"><i>getdate</i>()</a>, <a href="../functions/gmtime.html"><i>gmtime</i>()</a>, <a href="../functions/localtime.html"><i>localtime</i>()</a>, <a href="../functions/mktime.html"><i>mktime</i>()</a>, <a href="../functions/nanosleep.html"><i>nanosleep</i>()</a>, <a href="../functions/strftime.html"><i>strftime</i>()</a>, <a href="../functions/strptime.html"><i>strptime</i>()</a>, <a href="../functions/sysconf.html"><i>sysconf</i>()</a>, <a href="../functions/time.html"><i>time</i>()</a>, <a href="../functions/timer_create.html"><i>timer_create</i>()</a>, <a href="../functions/timer_delete.html"><i>timer_delete</i>()</a>, <ahref="../functions/timer_getoverrun.html"><i>timer_getoverrun</i>()</a>, <i>tzname</i>, <a href="../functions/tzset.html"><i>tzset</i>()</a>, <a href="../functions/utime.html"><i>utime</i>()</a></p></blockquote><h4><a name="tag_13_76_08"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 1. Derived from Issue 1 of the SVID.</p></blockquote><h4><a name="tag_13_76_09"></a>Issue 5</h4><blockquote><p>The DESCRIPTION is updated for alignment with the POSIX Realtime Extension and the POSIX Threads Extension.</p></blockquote><h4><a name="tag_13_76_10"></a>Issue 6</h4><blockquote><p>The Open Group Corrigendum U035/6 is applied. In the DESCRIPTION, the types <b>clockid_t</b> and <b>timer_t</b> have beendescribed.</p><p>The following changes are made for alignment with the ISO POSIX-1:1996 standard:</p><ul><li><p>The POSIX timer-related functions are marked as part of the Timers option.</p></li></ul><p>The symbolic name CLK_TCK is removed. Application usage is added describing how its equivalent functionality can be obtainedusing <a href="../functions/sysconf.html"><i>sysconf</i>()</a>.</p><p>The <a href="../functions/clock_getcpuclockid.html"><i>clock_getcpuclockid</i>()</a> function and manifest constantsCLOCK_PROCESS_CPUTIME_ID and CLOCK_THREAD_CPUTIME_ID are added for alignment with IEEE Std 1003.1d-1999.</p><p>The manifest constant CLOCK_MONOTONIC and the <a href="../functions/clock_nanosleep.html"><i>clock_nanosleep</i>()</a> functionare added for alignment with IEEE Std 1003.1j-2000.</p><p>The following changes are made for alignment with the ISO/IEC 9899:1999 standard:</p><ul><li><p>The range for seconds is changed from [0,61] to [0,60].</p></li><li><p>The <b>restrict</b> keyword is added to the prototypes for <a href="../functions/asctime_r.html"><i>asctime_r</i>()</a>, <ahref="../functions/gmtime_r.html"><i>gmtime_r</i>()</a>, <a href="../functions/localtime_r.html"><i>localtime_r</i>()</a>, <a href="../functions/strftime.html"><i>strftime</i>()</a>, <a href="../functions/strptime.html"><i>strptime</i>()</a>, <a href="../functions/timer_create.html"><i>timer_create</i>()</a>, and <a href="../functions/timer_settime.html"><i>timer_settime</i>()</a>.</p></li></ul><p>IEEE PASC Interpretation 1003.1 #84 is applied adding the statement that symbols from the <a href="../basedefs/signal.h.html"><i><signal.h></i></a> header may be made visible when the <i><time.h></i> header isincluded.</p><p>Extensions beyond the ISO C standard are marked.</p></blockquote><div class="box"><em>End of informative text.</em></div><hr><hr size="2" noshade><center><font size="2"><!--footer start-->UNIX ® is a registered Trademark of The Open Group.<br>POSIX ® is a registered Trademark of The IEEE.<br>[ <a href="../mindex.html">Main Index</a> | <a href="../basedefs/contents.html">XBD</a> | <a href="../utilities/contents.html">XCU</a> | <a href="../functions/contents.html">XSH</a> | <a href="../xrat/contents.html">XRAT</a>]</font></center><!--footer end--><hr size="2" noshade></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -