Strftime Date Without Leading Zeros

[Solved] Strftime Date Without Leading Zeros | Perl - Code Explorer | yomemimo.com
Question : strftime date without leading zeros

Answered by : talented-thrush-kniephelq460

Actually I had the same problem and I realized that, if you add a hyphen between the % and the letter, you can remove the leading zero.
For example %Y/%-m/%-d.
This only works on Unix (Linux, OS X), not Windows (including Cygwin). On Windows, you would use #, e.g. %Y/%#m/%#d.

Source : https://stackoverflow.com/questions/904928/python-strftime-date-without-leading-0 | Last Update : Mon, 14 Jun 21

Answers related to strftime date without leading zeros

Code Explorer Popular Question For Perl