"""
变更日期格式
elementTime=2021/12/1
return:2021/12/01
"""
def date_convert(elementTime):
timeArray=time.strptime(elementTime, "%Y/%m/%d")
otherStyleTime =time.strftime("%Y/%m/%d", timeArray)
return otherStyleTime
将不含有“0”的日期变更为带“0”的
"""
变更日期格式
elementTime=2021/12/1
return:2021/12/01
"""
def date_convert(elementTime):
timeArray=time.strptime(elementTime, "%Y/%m/%d")
otherStyleTime =time.strftime("%Y/%m/%d", timeArray)
return otherStyleTime
将不含有“0”的日期变更为带“0”的