@author jackzhenguo @desc @date 2019/11/16
124 时间转数组及常用格式
In [68]: str_to_struct = time.strptime(format_time,'%Y-%m-%d %H:%M:%S') In [69]: str_to_struct Out[69]: time.struct_time(tm_year=2020, tm_mon=2, tm_mday=22, tm_hour=11, tm_min=19, tm_sec=19, tm_wday=5, tm_yday=53, tm_isdst=-1)
最后再记住常用字符串格式
常用字符串格式
%m:月
%M: 分钟
%Y Year with century as a decimal number. %m Month as a decimal number [01,12]. %d Day of the month as a decimal number [01,31]. %H Hour (24-hour clock) as a decimal number [00,23]. %M Minute as a decimal number [00,59]. %S Second as a decimal number [00,61]. %z Time zone offset from UTC. %a Locale's abbreviated weekday name. %A Locale's full weekday name. %b Locale's abbreviated month name.