This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++20 status.
%y/%Y
is missing locale alternative versionsSection: 29.13 [time.parse] Status: C++20 Submitter: Tomasz Kamiński Opened: 2019-06-29 Last modified: 2021-02-25
Priority: 0
View other active issues in [time.parse].
View all other issues in [time.parse].
View all issues with C++20 status.
Discussion:
The year format specifier ('y', 'Y')
are missing the locale alternative
version ('%EY', '%Ey' and '%Oy')
. That makes it inconsistent with the
POSIX
strftime
specification:
%Ey
Replaced by the offset from %EC
(year only) in the locale's
alternative representation.
%EY
Replaced by the full alternative year representation.
%Oy
Replaced by the year (offset from %C
) using the locale's
alternative numeric symbols.
and parse
specifiers 29.13 [time.parse] that accepts these modified command.
[2019-07 Issue Prioritization]
Status to Tentatively Ready after five positive votes on the reflector.
Proposed resolution:
This wording is relative to N4820.
[Drafting note: For the
'%Oy'
specifier we preserve consistency with the current specification for'%Od'
and'%Oe'
from Table 87 "Meaning offormat
conversion specifier" [tab:time.format.spec]:
%d
[…] The modified command%Od
produces the locale's alternative representation.
%e
[…] The modified command%Oe
produces the locale's alternative representation.as their corresponding POSIX specification is matching one for
'%Oy'
:
%Od
Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading zeros if there is any alternative symbol for zero; otherwise, with leading<space>
characters.
%Oe
Replaced by the day of the month, using the locale's alternative numeric symbols, filled as needed with leading<space>
characters.]
Modify "Table 87 — Meaning of format
conversion specifiers"
[tab:time.format.spec] as indicated:
Table 87 — Meaning of format
conversion specifiers [tab:time.format.spec]Specifier Replacement […]
%y
The last two decimal digits of the year. If the result is a single digit it is prefixed by 0
. The modified command%Oy
produces the locale's alternative representation. The modified command%Ey
produces the locale's alternative representation of offset from%EC
(year only).%Y
The year as a decimal number. If the result is less than four digits it is left-padded with 0
to four digits. The modified command%EY
produces the locale's alternative full year representation.[…]