Conversation
9981575 to
91a9100
Compare
|
Thanks for the PR but what is the motivation behind this change? |
|
I needed a space padded version of the month number and GCC's strftime seems to support the padding modifier for %m (and %j), in addition to the types fmt already supports. %e exists for the day of the month but there's nothing similar for the month number. As for the year, fmt differs from GCC's strftime in that gcc's always does no padding for %Y, while fmt always does 4 digit padding, so I figured it made sense to add an option that would allow for similar behavior. |
|
|
|
It does seem to differ depending on platform. MSVC's implementation will zero pad the year to 4 digits. %C and %y also technically behaves differently as well. https://godbolt.org/z/T9ssj8fan. Century is never padded, Short year has padding modifiers. Also I realized that I forgot about %d (which also has GCC padding modifiers), %e will suffice for space padded, but the nonpadded won't exist. Interestingly the zero padding modifier works on %e in GCC. |
|
Both Python's |
|
Merged, thanks! |
Added some padding modifiers for additional presentation types.
Changing the padding modifier for year does kind of break the convention of %C + %y = %Y though. I wanted to also add in century and short year but I wasn't sure how that should be handled.