Convert an RFC 3339 time to a standard Python timestamp

后端 未结 14 1813
Happy的楠姐
Happy的楠姐 2020-12-03 04:40

Is there an easy way to convert an RFC 3339 time into a regular Python timestamp?

I\'ve got a script which is reading an ATOM feed and I\'d like to be able to compar

14条回答
  •  失恋的感觉
    2020-12-03 05:33

    I have been doing a deep dive in dateimes and RFC3339 and recently come across the arrow library and have just used and solved my problem:

    import arrow
    
    date_string = "2015-11-24 00:00:00+00:00"
    my_datetime = arrow.get(date_string).datetime
    

提交回复
热议问题