📄 getdate_err.html
字号:
<center><table border="1" cellpadding="3" align="center"><tr valign="top"><th align="center"><p class="tent"><b>Invocation</b></p></th><th align="center"><p class="tent"><b>Line in Template</b></p></th></tr><tr valign="top"><td align="left"><p class="tent">getdate("11/27/86")</p></td><td align="left"><p class="tent">%m/%d/%y</p></td></tr><tr valign="top"><td align="left"><p class="tent">getdate("27.11.86")</p></td><td align="left"><p class="tent">%d.%m.%y</p></td></tr><tr valign="top"><td align="left"><p class="tent">getdate("86-11-27")</p></td><td align="left"><p class="tent">%y-%m-%d</p></td></tr><tr valign="top"><td align="left"><p class="tent">getdate("Friday 12:00:00")</p></td><td align="left"><p class="tent">%A %H:%M:%S</p></td></tr></table></center></li><li><p>The following examples help to illustrate the above rules assuming that the current date is Mon Sep 22 12:19:47 EDT 1986 and the<i>LC_TIME</i> category is set to the default C locale:</p><center><table border="1" cellpadding="3" align="center"><tr valign="top"><th align="center"><p class="tent"><b>Input</b></p></th><th align="center"><p class="tent"><b>Line in Template</b></p></th><th align="center"><p class="tent"><b>Date</b></p></th></tr><tr valign="top"><td align="left"><p class="tent">Mon</p></td><td align="left"><p class="tent">%a</p></td><td align="left"><p class="tent">Mon Sep 22 12:19:47 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Sun</p></td><td align="left"><p class="tent">%a</p></td><td align="left"><p class="tent">Sun Sep 28 12:19:47 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Fri</p></td><td align="left"><p class="tent">%a</p></td><td align="left"><p class="tent">Fri Sep 26 12:19:47 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">September</p></td><td align="left"><p class="tent">%B</p></td><td align="left"><p class="tent">Mon Sep 1 12:19:47 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">January</p></td><td align="left"><p class="tent">%B</p></td><td align="left"><p class="tent">Thu Jan 1 12:19:47 EST 1987</p></td></tr><tr valign="top"><td align="left"><p class="tent">December</p></td><td align="left"><p class="tent">%B</p></td><td align="left"><p class="tent">Mon Dec 1 12:19:47 EST 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Sep Mon</p></td><td align="left"><p class="tent">%b %a</p></td><td align="left"><p class="tent">Mon Sep 1 12:19:47 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Jan Fri</p></td><td align="left"><p class="tent">%b %a</p></td><td align="left"><p class="tent">Fri Jan 2 12:19:47 EST 1987</p></td></tr><tr valign="top"><td align="left"><p class="tent">Dec Mon</p></td><td align="left"><p class="tent">%b %a</p></td><td align="left"><p class="tent">Mon Dec 1 12:19:47 EST 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Jan Wed 1989</p></td><td align="left"><p class="tent">%b %a %Y</p></td><td align="left"><p class="tent">Wed Jan 4 12:19:47 EST 1989</p></td></tr><tr valign="top"><td align="left"><p class="tent">Fri 9</p></td><td align="left"><p class="tent">%a %H</p></td><td align="left"><p class="tent">Fri Sep 26 09:00:00 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">Feb 10:30</p></td><td align="left"><p class="tent">%b %H:%S</p></td><td align="left"><p class="tent">Sun Feb 1 10:00:30 EST 1987</p></td></tr><tr valign="top"><td align="left"><p class="tent">10:30</p></td><td align="left"><p class="tent">%H:%M</p></td><td align="left"><p class="tent">Tue Sep 23 10:30:00 EDT 1986</p></td></tr><tr valign="top"><td align="left"><p class="tent">13:30</p></td><td align="left"><p class="tent">%H:%M</p></td><td align="left"><p class="tent">Mon Sep 22 13:30:00 EDT 1986</p></td></tr></table></center></li></ol></blockquote><h4><a name="tag_03_216_07"></a>APPLICATION USAGE</h4><blockquote><p>Although historical versions of <i>getdate</i>() did not require that <a href="../basedefs/time.h.html"><i><time.h></i></a> declare the external variable <i>getdate_err</i>, this volume ofIEEE Std 1003.1-2001 does require it. The standard developers encourage applications to remove declarations of<i>getdate_err</i> and instead incorporate the declaration by including <a href="../basedefs/time.h.html"><i><time.h></i></a>.</p><p>Applications should use <tt>%Y</tt> (4-digit years) in preference to <tt>%y</tt> (2-digit years).</p></blockquote><h4><a name="tag_03_216_08"></a>RATIONALE</h4><blockquote><p>In standard locales, the conversion specifications <tt>%c</tt>, <tt>%x</tt>, and <tt>%X</tt> do not include unsupportedconversion specifiers and so the text regarding results being undefined is not a problem in that case.</p></blockquote><h4><a name="tag_03_216_09"></a>FUTURE DIRECTIONS</h4><blockquote><p>None.</p></blockquote><h4><a name="tag_03_216_10"></a>SEE ALSO</h4><blockquote><p><a href="ctime.html"><i>ctime</i>()</a>, <a href="localtime.html"><i>localtime</i>()</a>, <a href="setlocale.html"><i>setlocale</i>()</a>, <a href="strftime.html"><i>strftime</i>()</a>, <a href="times.html"><i>times</i>()</a>,the Base Definitions volume of IEEE Std 1003.1-2001, <a href="../basedefs/time.h.html"><i><time.h></i></a></p></blockquote><h4><a name="tag_03_216_11"></a>CHANGE HISTORY</h4><blockquote><p>First released in Issue 4, Version 2.</p></blockquote><h4><a name="tag_03_216_12"></a>Issue 5</h4><blockquote><p>Moved from X/OPEN UNIX extension to BASE.</p><p>The last paragraph of the DESCRIPTION is added.</p><p>The <tt>%C</tt> conversion specification is added, and the exact meaning of the <tt>%y</tt> conversion specification isclarified in the DESCRIPTION.</p><p>A note indicating that this function need not be reentrant is added to the DESCRIPTION.</p><p>The <tt>%R</tt> conversion specification is changed to follow historical practice.</p></blockquote><h4><a name="tag_03_216_13"></a>Issue 6</h4><blockquote><p>The DESCRIPTION is updated to refer to "seconds since the Epoch" rather than "seconds since 00:00:00 UTC (CoordinatedUniversal Time), January 1 1970" for consistency with other <i>time</i> functions.</p><p>The description of <tt>%S</tt> is updated so that the valid range is [00,60] rather than [00,61].</p><p>The DESCRIPTION is updated to refer to conversion specifications instead of field descriptors for consistency with otherfunctions.</p></blockquote><div class="box"><em>End of informative text.</em></div><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 + -