-
-
Notifications
You must be signed in to change notification settings - Fork 415
Open
Description
- I am on the latest Pendulum version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- OS version and name: macOS Big Sur
- Pendulum version: 2.1.2
Issue
from datetime import datetime,timezone
dt = datetime(2019, 8, 1, tzinfo=timezone.utc) # datetime.datetime(2019, 8, 1, 0, 0, tzinfo=datetime.timezone.utc)
pdt = pendulum.instance(dt) # DateTime(2019, 8, 1, 0, 0, 0, tzinfo=Timezone('+00:00'))
the timezone returned is Timezone('+00:00') instead of the expected Timezone('UTC') this is not consistent with the behaviour of the pendulum.datetime constructor:
pdt2 = pendulum.datetime(2019, 8, 1, tz=timezone.utc) # DateTime(2019, 8, 1, 0, 0, 0, tzinfo=Timezone('UTC'))
So the same original timezone timezone.utc is converted to Timezone('+00:00') by pendulum.instance() and to Timezone('UTC') by pendulum.datetime.
I consider that timezone.utc should be always interpreted as pendulum.timezone('UTC')
stripedpumpkin
Metadata
Metadata
Assignees
Labels
No labels