Modifier for %d parse flag does not match POSIX and format specification
Tomasz Kamiński

Created on 2019-06-13.00:00:00 last changed 2 months ago


Date: 2019-07-23.15:26:26

Proposed resolution:

This wording is relative to N4810.

  1. Modify [time.parse], Table 88 — "Meaning of parse flags", as indicated:

    Table 88 — Meaning of parse flags
    Flag Parsed value
    %d The day of the month as a decimal number. The modified command %Nd specifies the maximum number of characters to read. If N is not specified, the default is 2. Leading zeroes are permitted but not required. The modified command %EOd interprets the locale's alternative representation of the day of the month.
Date: 2019-08-23.18:06:54

[ 2019-07 Issue Prioritization ]

Status to Tentatively Ready after five positive votes on the reflector.

Date: 2019-06-15.00:00:00

[ 2019-06-24; Howard comments ]

This was simply a type-o in my documentation that infected the proposal and subsequently the C++ working draft.

None of std::time_put, C's strftime, or POSIX's strftime support %Ed but all support %Od. Furthermore the existing example implementation supports %Od but not %Ed. And all the existing example implementation does is forward to std::time_put.

Date: 2019-06-22.17:58:08

Currently, the '%d' parse flags accepts the 'E' modifier to parse the locale's alternative representation, see Table 88 — "Meaning of parse flags":

The modified command %Ed interprets the locale's alternative representation of the day of the month.

This is inconsistent with the POSIX strftime specification and the format functions, that uses 'O' to output alternate locale representation. Per Table 87 — "Meaning of format conversion specifiers":

The modified command %Od produces the locale's alternative representation.

Date User Action Args
2021-02-25 10:48:01adminsetstatus: wp -> c++20
2019-11-19 14:48:30adminsetstatus: voting -> wp
2019-10-07 02:48:00adminsetstatus: ready -> voting
2019-07-23 15:26:26adminsetmessages: + msg10500
2019-07-23 15:26:26adminsetstatus: new -> ready
2019-06-24 18:15:54adminsetmessages: + msg10465
2019-06-15 20:23:45adminsetmessages: + msg10444
2019-06-13 00:00:00admincreate