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)

 

posted on 2018-10-17 15:18  吱吱了了  阅读(340)  评论(0编辑  收藏  举报

导航