Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTC offsets seem to be wrong #18

Closed
Ngg971 opened this issue Oct 22, 2018 · 0 comments
Closed

UTC offsets seem to be wrong #18

Ngg971 opened this issue Oct 22, 2018 · 0 comments

Comments

@Ngg971
Copy link

Ngg971 commented Oct 22, 2018

Hi,

I am using your library extensively and love it. However recently I noticed what I believe is a bug in the UTC offsets for various timezones. It seems related to a 'premptive' switch back from daylight savings.

For example, here I create a naive datetime (2018-02-01 6:00:00) and localize it to the London timezone. However when I print the tz-aware datetime object, it shows GMT0:00:00 and when I print the utcoffset() it also shows a difference of 0:00:00.

>>> local_date
datetime.datetime(2015, 2, 1, 6, 0)
>>> res_timezone_one
<DstTzInfo 'Europe/London' LMT-1 day, 23:59:00 STD>
>>> aware_datetime = res_timezone_one.localize(local_date)
>>> aware_datetime
datetime.datetime(2015, 2, 1, 6, 0, tzinfo=<DstTzInfo 'Europe/London' GMT0:00:00 STD>)
>>> aware_datetime.utcoffset()
datetime.timedelta(0)

This is wrong, as London is one hour ahead of GMT at the moment (until October 28th). I am also getting a similar problem with America/Denver.

Thanks,
Nathanael

@Ngg971 Ngg971 closed this as completed Oct 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant