Invalid DST boundaries/utc_transition_times

Asked by Vijay Kal on 2019-09-13

I have started using pytz to find DST boundaries for any given zone using utc_transition_times. I see that we have incorrect DST boundaries for various zones.
If we have invalid boundaries any check to see if a given date is in DST during this invalid period would be incorrect

Israel will still be under daylight savings on Oct 9th 2019 , but pytz incorrectly identifies this date as no tin DST (offset = 0)

Python code to recreate:
print bool(timezone('Asia/Jerusalem').dst(datetime(2019, 10, 9), is_dst=None))

more ex:
Asia/Jerusalem: Per Olson DST starts in last week of march and ends in last week of october. But as you see the end dates are incorrect end dates
datetime.datetime(2019, 3, 29, 0, 0), datetime.datetime(2019, 10, 5, 23, 0)
datetime.datetime(2020, 3, 27, 0, 0), datetime.datetime(2020, 9, 26, 23, 0)
datetime.datetime(2021, 3, 26, 0, 0), datetime.datetime(2021, 9, 11, 23, 0)

Correct end date is last week of October. Ex: for 2019 the date should have been datetime.datetime(2019, 10, 27, 23, 0)

Asia/Baku should not have any DST

Question information

English Edit question
pytz Edit question
No assignee Edit question
Solved by:
Vijay Kal
Last query:
Last reply:
Vijay Kal (vkalusani) said : #1

Had pytz-2012c previously manually installed ..sorry for the confusion adn waste of your time.