2
我是新手在Python中,我无法理解如何正确格式化日期。AttributeError:'time.struct_time'对象没有属性'toordinal'
我的数据是这样的Fri, 09 Dec 2011 06:50:37 UTC
我准备这样的:
dates.append(time.strptime(row[5], "%a, %d %b %Y %H:%M:%S %Z"))
然后我尝试使用它
dates = matplotlib.dates.date2num(dates)
得到以下错误:
AttributeError: 'time.struct_time' object has no attribute 'toordinal'
感谢答案,但现在,我得到`AttributeError的:“模块”对象有没有属性“strptime'` – 2011-12-16 18:18:20