热线电话:13121318867

登录
2019-07-01 阅读量: 740
日期字符串

日期字符串 --> 时间元组

time.strptime(string, format) # string:日期字符串,format:该日期字符串对应的格式化格式

例子:

import time

time_str_to_tuple = time.strptime("2019-01-30 11:48:07", "%Y-%m-%d %H:%M:%S")

print time_str_to_tuple # time.struct_time(tm_year=2019, tm_mon=1, tm_mday=30, tm_hour=11, tm_min=48, tm_sec=7, tm_wday=2, tm_yday=30, tm_isdst=-1)

0.0000
4
关注作者
收藏
评论(0)

发表评论

暂无数据