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.

3245. Unnecessary restriction on '%p' parse specifier

Section: 29.13 [time.parse] Status: C++20 Submitter: Tomasz Kamiński Opened: 2019-07-31 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 current specification for the '%p' flag in "[tab:time.parse.spec] Meaning of parse flags" places a restriction of it's placement with regards to the '%I' command:

The locale's equivalent of the AM/PM designations associated with a 12-hour clock. The command %I must precede %p in the format string.

This restriction makes the migration to new API more difficult, as it is not present for the POSIX strptime nor in the example implementation of the library. Per Howard's comment:

Actually this is an obsolete requirement and it should be struck. The first time I implemented this I didn't know how to do it without this requirement. I've since reimplemented it without needing this.

[2019-08-17 Issue Prioritization]

Status to Tentatively Ready and priority to 0 after eight positive votes on the reflector.

Proposed resolution:

This wording is relative to N4830.

  1. Modify Table 99 "Meaning of parse flags [tab:time.parse.spec]" in 29.13 [time.parse] as indicated:

    Table 99: Meaning of parse flags [tab:time.parse.spec]
    Flag Parsed value
    […]
    %p The locale's equivalent of the AM/PM designations associated with a 12-hour clock. The command %I must precede %p in the format string.
    […]