def strptime(date):
"""Convert the date string into a 9 tuple"""
df = [0,0,0,0,0,0,0,0,0]
sp = date.split(' ')
spt = sp[3].split(':')
df[0] = int(sp[4]) # Year
if abbrevMonthNames.has_key(sp[1]):
df[1] = int(abbrevMonthNames[sp[1]])
else:
df[1] = 1 # Month
df[2] = int(sp[2]) # Day
df[3] = int(spt[0]) # Hour
df[4] = int(spt[1]) # Minute
df[5] = int(spt[2]) # Second
df[6] = calendar.weekday(df[0], df[1], df[2])
return df
评论列表
文章目录