pytz's documentation says:
Note that this instance [pytz.timezone('UTC')] is not the same instance (or implementation) as other timezones with the same meaning (GMT, Greenwich, Universal, etc.).
and indeed:
>>> pytz.timezone('UTC') is pytz.timezone('GMT')
False
So... what's the difference?
When should I use pytz.timezone('UTC')
and when should I use pytz.timezone('GMT')
?
The UTC implementation is a tzinfo implementation that will at all times return 0 minutes offset.
The timezone you get when you do pytz.timezone('GMT') is the GMT timezone defined in the Olson database. It also will return 0 at all times, but in a more complicated manner.
Use UTC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With