Section: 30.13 [time.parse] Status: C++20 Submitter: Tomasz Kamiński Opened: 2019-08-06 Last modified: 2021-02-25
Priority: 2
View other active issues in [time.parse].
View all other issues in [time.parse].
View all issues with C++20 status.
Discussion:
The current specification of the locale modifiers for the parse flags in
"[tab:time.parse.spec] Meaning of parse flags" is
inconsistent with the
POSIX strptime specification:
New flags %OC, %Ou are added
Flags %OI, %OU, %OW are missing
Per Howard's comment:
I only invented in a couple places for these flags, and none of them involved locale-dependent stuff. If we are inconsistent with POSIX/C on this, it's a bug. Rationale,std::get_timeis already specified in terms ofstrptime, and we can't afford to be inventive with locale-dependent things.
Note that, due above, the inconsistency between
POSIX strftime specification that supports %Ou
and %OV that are not handled by
strptime should be (by design) reflected in "[tab:time.format.spec]
Meaning of conversion specifiers" and "[tab:time.parse.spec] Meaning of
parse flags" tables.
%d modifier was addressed by LWG 3218.
[2020-02 Status to Immediate on Thursday morning in Prague.]
Proposed resolution:
This wording is relative to N4830.
Modify Table 99 "Meaning of parse flags [tab:time.parse.spec]" in
30.13 [time.parse] as indicated:
Table 99: Meaning of parseflags [tab:time.parse.spec]Flag Parsed value […]%CThe century as a decimal number. The modified command %NCspecifies the maximum number of characters to read. IfNis not specified, the default is2. Leading zeroes are permitted but not required. The modified commands%ECandinterprets the locale's alternative representation of the century.%OC[…]%IThe hour (12-hour clock) as a decimal number. The modified command %NIspecifies the maximum number of characters to read. IfNis not specified, the default is2. Leading zeroes are permitted but not required. The modified command%OIinterprets the locale's alternative representation.[…]%uThe ISO weekday as a decimal number ( 1-7), where Monday is1. The modified command%Nuspecifies the maximum number of characters to read. IfNis not specified, the default is1. Leading zeroes are permitted but not required.The modified command%Ouinterprets the locale's alternative representation.%UThe week number of the year as a decimal number. The first Sunday of the year is the first day of week 01. Days of the same year prior to that are in week00. The modified command%NUspecifies the maximum number of characters to read. IfNis not specified, the default is2. Leading zeroes are permitted but not required. The modified command%OUinterprets the locale's alternative representation.[…]%WThe week number of the year as a decimal number. The first Monday of the year is the first day of week 01. Days of the same year prior to that are in week00. The modified command%NWspecifies the maximum number of characters to read. IfNis not specified, the default is2. Leading zeroes are permitted but not required. The modified command%OWinterprets the locale's alternative representation.[…]