Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
durka opened this issue Jan 16, 2024 · 3 comments
Closed

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

durka opened this issue Jan 16, 2024 · 3 comments

Comments

@durka
Copy link

durka commented Jan 16, 2024

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.

@phprus
Copy link
Contributor

phprus commented Jan 16, 2024

Fix: #3812

@durka
Copy link
Author

durka commented Jan 16, 2024

That was fast!

@phprus
Copy link
Contributor

phprus commented Jan 16, 2024

@durka
Please, test this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants