Timezone offset sign reversed by dateutil?

后端 未结 2 1294
无人及你
无人及你 2020-11-30 10:59

Does anyone know why python\'s dateutil reverses the sign of the GMT offset when it parses the datetime field?

Apparently this feature is a known outcome of not only

2条回答
  •  抹茶落季
    2020-11-30 11:07

    The source code for dateutil.parser.parse explains this.

    Check for something like GMT+3, or BRST+3. Notice that it doesn't mean "I am 3 hours after GMT", but "my time +3 is GMT". If found, we reverse the logic so that timezone parsing code will get it right.

    And a further comment:

    With something like GMT+3, the timezone is not GMT.

提交回复
热议问题