pytz and Etc/GMT-5

后端 未结 2 1671
忘了有多久
忘了有多久 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: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.

提交回复
热议问题