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

DST transition behavior #28

Closed
garyaviv opened this issue Nov 28, 2022 · 1 comment
Closed

DST transition behavior #28

garyaviv opened this issue Nov 28, 2022 · 1 comment

Comments

@garyaviv
Copy link

Running the following code under Python 3.8.10 croniter-1.3.7
Note DST starts at 1 AM on 2022-03-12

from datetime import datetime
from croniter import croniter
from dateutil import tz
ny = tz.gettz('America/New_York')
d1=datetime(2022, 3, 12, 22, 0, 30, tzinfo=ny)
it = croniter("0 * * * *", d1)
for x in range(0, 10):
print(it.get_next(ret_type=datetime))

I get:
2022-03-12 23:00:00-05:00
2022-03-13 00:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00
03-13 01:00:00-05:00
2022-03-13 01:00:00-05:00

I expected:
2022-03-12 23:00:00-05:00
2022-03-13 00:00:00-05:00
2022-03-13 01:00:00-05:00
2022-03-13 03:00:00-04:00
2022-03-13 04:00:00-04:00
2022-03-13 05:00:00-04:00
2022-03-13 06:00:00-04:00
2022-03-13 07:00:00-04:00
2022-03-13 08:00:00-04:00
2022-03-13 09:00:00-04:00

@kiorky
Copy link
Owner

kiorky commented Nov 28, 2022

dup #1

@kiorky kiorky closed this as completed Nov 28, 2022
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