Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 496 Bytes

116.md

File metadata and controls

19 lines (14 loc) · 496 Bytes
@author jackzhenguo
@desc 
@date 2019/10/16

116 字符时间转时间

from time import strptime

# parse str time to struct time
struct_time = strptime('2019-12-22 10:10:08', "%Y-%m-%d %H:%M:%S")
print(struct_time) # struct_time类型就是time中的一个类

# time.struct_time(tm_year=2019, tm_mon=12, tm_mday=22, tm_hour=10, tm_min=10, tm_sec=8, tm_wday=6, tm_yday=356, tm_isdst=-1)
[上一个例子](115.md) [下一个例子](117.md)