python - How to parse this string by strptime -


somtetimes see date strings "2015-04-09t10:59:22z". "t" , "z" chars here? how parse string python's time.strptime?

astr = "2015-04-09t10:59:22z" time.strptime(astr, '%y-%m-%dt%h:%m:%sz') ## returns time.struct_time(tm_year=2015, tm_mon=4, tm_mday=9, tm_hour=10, tm_min=59, tm_sec=22, tm_wday=3, tm_yday=99, tm_isdst=-1) 

Popular posts from this blog