Python笔记27----时间解析

1、将时间字符串解析成真正的时间 time.strptime

http://www.runoob.com/python/att-time-strptime.html

代码:

 
import time
 
struct_time = time.strptime("30 Nov 00", "%d %b %y")
print("返回的元组: %s " % (struct_time,))
print(type(struct_time))
print("返回的元组: %s " % struct_time.tm_year)
原文地址:https://www.cnblogs.com/Lee-yl/p/9804362.html