Parse CEST/CET time in python

后端 未结 2 1862
失恋的感觉
失恋的感觉 2020-12-22 01:46

I have these date strings:

Fri Oct  7 16:00:09 CEST 2011

I want to convert them to UTC. I have tried with this implementation:



        
相关标签:
2条回答
  • 2020-12-22 02:48

    Use the parsedatetime library.

    0 讨论(0)
  • 2020-12-22 02:48

    There are two problems here:

    1. You're using "%m" instead of "%b"
    2. The standard lib can't parse "CEST", it understands only very few time zone names. See also here: What possible values does datetime.strptime() accept for %Z?
    0 讨论(0)
提交回复
热议问题