pytz and Etc/GMT-5

后端 未结 2 1661
忘了有多久
忘了有多久 2020-12-11 03:52

I\'m having trouble understanding the conversion between the \"Etc/GMT-5\" timezone and UTC in pytz.

>>> dt = datetime(2009, 9, 9, 10, 0) # Septembe         


        
相关标签:
2条回答
  • 2020-12-11 04:19

    This bug report explains this behavior. Apparently they know that it is all inverted, but that's because anything else would break compatibility.

    0 讨论(0)
  • 2020-12-11 04:29

    This is apparently a POSIX thing. From Wikipedia:

    In order to conform with the POSIX style, those zones beginning with "Etc/GMT" have their sign reversed from what most people expect. In this style, zones west of GMT have a positive sign and those east have a negative sign.

    0 讨论(0)
提交回复
热议问题