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.
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 fromH,M, andS.However, a difference from
std::strftimeis 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.