Skip to content

chrono glibc '-' ext applies to following components within a spec #3811

Description

@durka

In the latest version, @ShawnZhong implemented #2959 via #3271. This allows the use of - as a modifier in chrono format specs to omit the leading zero from H, M, and S.

However, a difference from std::strftime is that the modification "sticks" to an entire format spec, so {:-M:%S} behaves differently than {:%-M}:{:%S} (the former strips the leading zero from minutes and seconds, while the latter only modifies the minutes). Is this intended behavior?

Here is a godbolt repro.

As a side note, unless I missed it the - extension for chrono specs is not mentioned in the documentation.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions