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

'Europe/Dublin' sometimes set to defunct "Dublin Mean Time" timezone #57

Open
further-reading opened this issue Mar 4, 2021 · 1 comment

Comments

@further-reading
Copy link

I'm trying to have a script that works with local time in Ireland but it seems that when you set a datetime object to Europe/Dublin and convert to UTC it adds 25 minutes and doesn't offset during DST.

>>> import datetime, pytz
>>> test = datetime.datetime(2018, 3, 1, 8, tzinfo=pytz.timezone('Europe/Dublin'))
>>> test.astimezone(pytz.timezone('UTC')).time()
datetime.time(8, 25)
>>> testDST = datetime.datetime(2018, 3, 30, 8, tzinfo=pytz.timezone('Europe/Dublin'))
>>> testDST.astimezone(pytz.timezone('UTC')).time()
datetime.time(8, 25)

It appears that it might be using Dublin Mean Time, which has been defunct since 1916.

Interestingly, this does not happen when going from UTC to Europe/Dublin.

>>> import datetime, pytz
>>> test = datetime.datetime(2018, 3, 1, 8, tzinfo=pytz.timezone('UTC'))
>>> test.astimezone(pytz.timezone('Europe/Dublin')).time()
datetime.time(8, 0)
>>> testDST = datetime.datetime(2018, 3, 30, 8, tzinfo=pytz.timezone('UTC'))
>>> testDST.astimezone(pytz.timezone('Europe/Dublin')).time()
datetime.time(9, 0)
@ackerleytng
Copy link

I think it might just be how you're using it: TIL: https://stackoverflow.com/questions/24856643/unexpected-results-converting-timezones-in-python

>>> print(pytz.timezone("Europe/Dublin").localize(datetime(2018, 3, 30, 8)))
2018-03-30 08:00:00+01:00

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

2 participants