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
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…