我明白了
time data '19/Apr/2011:22:12:39' does not match format '%d/%b/%y:%H:%M:%S'
Run Code Online (Sandbox Code Playgroud)
使用时 datetime.strptime('19/Apr/2011:22:12:39','%d/%b/%y:%H:%M:%S')
我究竟做错了什么?
Edu*_*nec 23
尝试%d/%b/%Y:%H:%M:%S
改为 - %y
现在意味着11.
您可以轻松地"调试"日期时间格式date
(在shell上而不是在python上,我的意思是,假设您正在运行GNU/Linux或类似):
date '+%d/%b/%Y:%H:%M:%S'
05/May/2011:09:00:41
Run Code Online (Sandbox Code Playgroud)