A NOTE has been added to this issue. ====================================================================== https://austingroupbugs.net/view.php?id=1727 ====================================================================== Reported By: kre Assigned To: ====================================================================== Project: Issue 8 drafts Issue ID: 1727 Category: System Interfaces Type: Enhancement Request Severity: Objection Priority: normal Status: New Name: Robert Elz Organization: User Reference: Section: XSH 3 / strptime Page Number: 2146-7 Line Number: 70221-2, 70250-7 Final Accepted Text: ====================================================================== Date Submitted: 2023-05-14 19:23 UTC Last Modified: 2023-07-13 15:17 UTC ====================================================================== Summary: strptime() spec needs updates to deal with other changes. ======================================================================
---------------------------------------------------------------------- (0006384) geoffclare (manager) - 2023-07-13 15:17 https://austingroupbugs.net/view.php?id=1727#c6384 ---------------------------------------------------------------------- On page 2145 line 70181 section strptime() (%a), append: <blockquote>The <i>tm_wday</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to the corresponding day of the week number (Sunday=0).</blockquote> On page 2146 line 70184 section strptime() (%b), append: <blockquote>The <i>tm_mon</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to the corresponding month number.</blockquote> On page 2146 line 70186 section strptime() (%c), append: <blockquote>The members of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the conversions present in the locale's <b>d_t_fmt</b> value.</blockquote> On page 2146 line 70189 section strptime() (%C), append: <blockquote>The <i>tm_year</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to the number formed by appending the last two digits of the year to these digits, minus 1900. If a <tt>y</tt> conversion is also performed, the last two digits of the year shall be those processed by the <tt>y</tt> conversion; otherwise, they shall be 00.</blockquote> On page 2146 line 70190 section strptime() (%d), append: <blockquote>The <i>tm_mday</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number.</blockquote> On page 2146 line 70191 section strptime() (%D), change: <blockquote>The date as <tt>%m/%d/%y</tt>.</blockquote> to: <blockquote>Equivalent to <tt>%m/%d/%y</tt>.</blockquote> On page 2146 line 70198 section strptime() (%F), append: <blockquote>The members of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the <tt>Y</tt>, <tt>m</tt>, and <tt>d</tt> conversions.</blockquote> On page 2146 line 70209 section strptime() (%H), append: <blockquote>The <i>tm_hour</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number.</blockquote> On page 2146 line 70211 section strptime() (%I), append: <blockquote>If a <tt>p</tt> conversion is also performed, the <i>tm_hour</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to the hour, by the 24-hour clock, corresponding to the combined results of the <tt>I</tt> and <tt>p</tt> conversions. If a <tt>p</tt> conversion is not also performed, the behavior is unspecified.</blockquote> On page 2146 line 70213 section strptime() (%j), append: <blockquote>The <i>tm_yday</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number minus 1.</blockquote> On page 2146 line 70214 section strptime() (%m), append: <blockquote>The <i>tm_mon</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number minus 1.</blockquote> On page 2146 line 70215 section strptime() (%M), append: <blockquote>The <i>tm_min</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number.</blockquote> On page 2146 line 70217 section strptime() (%p), append: <blockquote>If an <tt>I</tt> conversion is also performed, the <i>tm_hour</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the <tt>I</tt> conversion; otherwise, the behavior is unspecified.</blockquote> On page 2146 line 70219 section strptime() (%r), append: <blockquote>The members of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the conversions present in the locale's <b>t_fmt_ampm</b> value.</blockquote> On page 2146 line 70220 section strptime() (%R), change: <blockquote>The time as <tt>%H:%M</tt>.</blockquote> to: <blockquote>Equivalent to <tt>%H:%M</tt>.</blockquote> On page 2146 line 70222 section strptime() (%s), add a sentence: <blockquote>The effect of this number, if any, on the <b>tm</b> structure pointed to by <i>tm</i> is unspecified.</blockquote> and remove the CX shading from the description of the s conversion. On page 2147 line 70223 section strptime() (%S), append: <blockquote>The <i>tm_sec</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number.</blockquote> On page 2147 line 70225 section strptime() (%T), change: <blockquote>The time as <tt>%H:%M:%S</tt>.</blockquote> to: <blockquote>Equivalent to <tt>%H:%M:%S</tt>.</blockquote> On page 2147 line 70226 section strptime() (%u), append: <blockquote>The <i>tm_wday</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number modulo 7.</blockquote> On page 2147 line 70233 section strptime() (%w), append: <blockquote>The <i>tm_wday</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number.</blockquote> On page 2147 line 70237 section strptime() (%x), append: <blockquote>The members of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the conversions present in the locale's <b>d_fmt</b> value.</blockquote> On page 2147 line 70238 section strptime() (%X), append: <blockquote>The members of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the conversions present in the locale's <b>t_fmt</b> value.</blockquote> On page 2147 line 70238 section strptime() (%y), change: <blockquote>When <i>format</i> contains neither a <tt>C</tt> conversion specifier nor a <tt>Y</tt> conversion specifier, values in the range ...</blockquote> to: <blockquote>If a <tt>C</tt> conversion is not also performed, values in the range ...</blockquote> On page 2147 line 70243 section strptime() (%y), append: <blockquote>If a <tt>C</tt> conversion is also performed, the <i>tm_year</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set as specified for the <tt>C</tt> conversion; otherwise, the <i>tm_year</i> member shall be set to the calculated year minus 1900.</blockquote> On page 2147 line 70249 section strptime() (%Y), append: <blockquote>The <i>tm_year</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to this number minus 1900.</blockquote> On page 2147 line 70251 section strptime() (%Z), change: <blockquote>If this name matches <i>tzname</i>[1], and <i>tzname</i>[0] and <i>tzname</i>[1] differ, then the <i>tm_isdst</i> field of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to 1. Otherwise, if this name matches <i>tzname</i>[0] then the <i>tm_isdst</i> field of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to 0. Any other effects on the <b>tm</b> structure pointed to by <i>tm</i> are unspecified.</blockquote> to: <blockquote>If this name matches the name pointed to by <i>tzname</i>[1], and the names pointed to by <i>tzname</i>[0] and <i>tzname</i>[1] differ, then the <i>tm_isdst</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to 1. Otherwise, if this name matches the name pointed to by <i>tzname</i>[0] then the <i>tm_isdst</i> member of the <b>tm</b> structure pointed to by <i>tm</i> shall be set to 0. The <i>tm_zone</i> and <i>tm_gmtoff</i> members of the structure may also be set in an unspecified manner. Members other than <i>tm_isdst</i>, <i>tm_zone</i>, and <i>tm_gmtoff</i> may be affected if an <tt>s</tt> conversion is also performed but shall otherwise not be affected.</blockquote> On page 2149 line 70311 section strptime(), change: <blockquote>If a match is found, values for the appropriate <b>tm</b> structure members are set to values corresponding to the locale information.</blockquote> to: <blockquote>If a match is found, values for the affected <b>tm</b> structure members are set as specified in the description of the conversion specification.</blockquote> After page 2150 line 70349 section strptime() (APPLICATION USAGE), add: <blockquote>The effect of the <tt>s</tt> conversion is unspecified because existing implementations differ in behavior. Some do a conversion equivalent to <i>gmtime</i>(), ignoring all available timezone information; some do a conversion equivalent to <i>localtime</i>(), using the same timezone it would use and ignoring any timezone information provided by a <tt>z</tt> or <tt>Z</tt> conversion. Although none has been observed, there may be existing (or future) implementations that use timezone information provided by a <tt>z</tt> or <tt>Z</tt> conversion, although using the latter would not be reliable as timezone names are often ambiguous. Applications that need to convert a seconds since the Epoch value to a <b>tm</b> structure should call <i>gmtime</i>() or <i>localtime</i>() (or their thread-safe equivalents) directly. The effect of the <tt>z</tt> conversion is unspecified because existing implementations differ in behavior. Some just use it to set the <i>tm_gmtoff</i> member of the <b>tm</b> structure; some use the value to adjust the other field members to represent UTC, convert the resulting time to a seconds since the Epoch value, and then convert back to a <b>tm</b> structure by the equivalent of <i>localtime</i>(). An application that needs either of these behaviors should perform the necessary processing explicitly itself. Although the <tt>Z</tt> conversion might be expected to set the <i>tm_zone</i> member of the <b>tm</b> structure, no existing implementation has been found that sets it. Applications that need it set should set it explicitly after calling <i>strptime</i>().</blockquote> Issue History Date Modified Username Field Change ====================================================================== 2023-05-14 19:23 kre New Issue 2023-05-14 19:23 kre Name => Robert Elz 2023-05-14 19:23 kre Section => XSH 3 / strptime 2023-05-14 19:23 kre Page Number => 2146-7 2023-05-14 19:23 kre Line Number => 70221-2, 70250-7 2023-05-15 14:25 kre Note Added: 0006285 2023-05-15 14:28 kre Note Edited: 0006285 2023-05-16 08:57 geoffclare Note Added: 0006286 2023-07-13 09:54 geoffclare Note Added: 0006383 2023-07-13 15:17 geoffclare Note Added: 0006384 ======================================================================