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

rrule generator skipping window during exit of DST #1351

Open
MarvinWinks opened this issue Mar 12, 2024 · 0 comments
Open

rrule generator skipping window during exit of DST #1351

MarvinWinks opened this issue Mar 12, 2024 · 0 comments

Comments

@MarvinWinks
Copy link

When using rrule to generate recurring events using a dttime having timezone=America/New_York, the returned times skip an hour, the second "go-around" for 1 AM ET.

Sample code:

from datetime import datetime
from dateutil import tz
from dateutil.rrule import rrule, SECONDLY

tz_ny = tz.tz.gettz('America/New_York')
dtstart = datetime(2024, 11, 3, 1, 52, 3, tzinfo=tz_ny)
for d in list(rrule(count=10, freq=SECONDLY, interval=240, dtstart=dtstart)):
    print(d)

Actual output

2024-11-03 01:52:03-04:00
2024-11-03 01:56:03-04:00
2024-11-03 02:00:03-05:00 # 02 unexpected
2024-11-03 02:04:03-05:00
2024-11-03 02:08:03-05:00
2024-11-03 02:12:03-05:00
2024-11-03 02:16:03-05:00
2024-11-03 02:20:03-05:00
2024-11-03 02:24:03-05:00
2024-11-03 02:28:03-05:00

Expected output

2024-11-03 01:52:03-04:00
2024-11-03 01:56:03-04:00
2024-11-03 01:00:03-05:00 # 01 expected
2024-11-03 01:04:03-05:00
2024-11-03 01:08:03-05:00
2024-11-03 01:12:03-05:00
2024-11-03 01:16:03-05:00
2024-11-03 01:20:03-05:00
2024-11-03 01:24:03-05:00
2024-11-03 01:28:03-05: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

1 participant