这是我的代码,我遇到了以下错误:['%m/%d/%y%h:%m:%s']由于我的日期和时间的格式与此完全相同,我看不出有什么问题。也许这是其他地方的问题?我试着改变一下格式,但没有成功。
ygya80vv1#
一切正常,但为什么要使用括号?只要写下:
newTime.append(datetime.datetime.strptime(str(elem), "%m/%d/%Y %H:%M:%S"))
如果要在newtime数组中添加数组,则需要使用:
newTime.append([datetime.datetime.strptime(str(elem), "%m/%d/%Y %H:%M:%S")])
1条答案
按热度按时间ygya80vv1#
一切正常,但为什么要使用括号?只要写下:
如果要在newtime数组中添加数组,则需要使用: