字符串利用%02d将月份前加0

i = 20190104
a = 2019
b = 1
c = 4

s = "%04d-%02d-%02d" % (a, b, c)

 

posted @ 2019-07-10 14:28  心媛意码  阅读(174)  评论(0编辑  收藏  举报