-
Notifications
You must be signed in to change notification settings - Fork 39
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
Croniter skips 2021-03-01 for "0 0 */10 * *" #178 (DST related bugs) #1
Comments
as said on taichino/croniter#147 (comment) and i wont have time to fix dst changes, unfortunatly, if you can, you may submit a PR. |
The last work i didnt have time to finish was there : kiorky/croniter-fork#34 |
Seems like some of these tickets are missing implementation detail differences about which I've noticed for our case at Sentry, we use the newer @pytest.mark.skipif(
sys.version_info < (3, 9),
reason="Test only valid on python 3.9 and above"
)
def test_dst_zoneinfo(self):
"""
Test DST crossover with zoneinfo
"""
from zoneinfo import ZoneInfo
# 5:00 AM EST before EDST crossover
tz = ZoneInfo("America/New_York")
ts = datetime(2024, 3, 9, 5, 0, 0, tzinfo=tz)
# Next tick is after the EDST crossover. Closk move forward one hour,
# but we would still expect the next cron iteration at 5:00 AM EDST.
ts_after_dst = croniter("0 5 * * *", ts).get_next(datetime)
self.assertEqual(ts_after_dst, datetime(2024, 3, 10, 5, 0, 0, tzinfo=tz)) This test case is producing The same test case using pytz def test_dst_pytz(self):
"""
Test DST crossover with zoneinfo
"""
# 5:00 AM EST before EDST crossover
tz = pytz.timezone("America/New_York")
ts = tz.localize(datetime(2024, 3, 9, 5, 0, 0))
# Next tick is after the EDST crossover. Closk move forward one hour,
# but we would still expect the next cron iteration at 5:00 AM EDST.
ts_after_dst = croniter("0 5 * * *", ts).get_next(datetime)
self.assertEqual(ts_after_dst, tz.localize(datetime(2024, 3, 10, 5, 0, 0))) This test passes. |
@evanpurkhiser have you looked into using |
@cuu508 chiming in grabbing users to another library is not something i ll tolerate on this tracker related to croniter issues. You have been warned. |
(originally reported in taichino/croniter#178)
Test snippet:
Result:
In the above output,
2021-03-01T00:00:00
is missing.The text was updated successfully, but these errors were encountered: