In Python, how do I convert a time.struct_time such as
time.struct_time(tm_year=2012, tm_mon=10, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=0, tm_yday=275, tm_isdst=-1)
to a list such as
[2012, 10, 1, 0, 0, 0, 0, 275, -1]
My motivation: I’m storing time.struct_time objects like the former in a json file and, when I retrieve them, they are lists like the latter. I need to compare one such list with a time.struct_time; hence my question.
Convert it with
list(obj), ex: