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