How to sort a list of time values?

后端 未结 4 819
再見小時候
再見小時候 2020-12-16 03:47

I have a python list of time values that I extracted from a web log. I have the list in the format of %H:%M:%S. How would I sort the time values in ascending o

4条回答
  •  误落风尘
    2020-12-16 03:58

    import time
    
    sorted((time.strptime(d, "%H:%M:%S") for d in time_list), reverse=True)
    

提交回复
热议问题