excel表中有数据写的不规范,日期有两种
20210808
202108/8
解决方法,替换掉斜杠,长度小于8位的填充0
day = '2021088'
print(len(day))
day2 = day[:6] + '0' + day[-1:]
print(day2)
'20210808'
excel表中有数据写的不规范,日期有两种
20210808
202108/8
解决方法,替换掉斜杠,长度小于8位的填充0
day = '2021088'
print(len(day))
day2 = day[:6] + '0' + day[-1:]
print(day2)
'20210808'