我正在将 Twitter created_at 日期转换为整数并使用以下代码,但出现索引不足错误:
creation_date = [time.strftime('%Y-%m-%d %H:%M:%S',time.strptime(status['created_at']
,'%a %b %d %H:%M:%S +0000 %Y')) for status in statuses]
for x in range(len(creation_date)):
year = int(creation_date[x][0:4])
month = int(creation_date[x][5:7])
day = int(creation_date[x][8:10])
newCreationDate = []
newCreationDate[x] = datetime(year,month,day)