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

Fix rrule fast forwarding across DST boundaries #15809

Merged

Conversation

fosterseth
Copy link
Member

@fosterseth fosterseth commented Feb 4, 2025

SUMMARY

Fixes an issue where schedules were not running at the correct time.

Details:

DST is Daylight Saving Time

If the rrule dtstart is "in" a DST period (i.e., March to November) and the current date is outside of the DST, then the fast forwarding is not correct.

This is because datetime timedeltas do not honor DST boundaries

The Fix:

Convert the rrule dtstart to UTC before doing operations. Then, convert back to the original timezone at the end.

ISSUE TYPE
  • Bug, Docs Fix or other nominal change
COMPONENT NAME
  • API

Fixes an issue where schedules were not running at
the correct time.

Details:

DST is Daylights Saving Time

If the rrule dtstart is "in" a DST period (i.e., March to November)
and the current date is outside of the DST, then the fast forwarding
is not correct.

This is because datetime timedeltas do not honor DST boundaries

The Fix:

Convert the rrule dtstart to UTC before doing operations. Then,
convert back to the original timezone at the end.

Signed-off-by: Seth Foster <[email protected]>
Copy link

sonarqubecloud bot commented Feb 4, 2025

@fosterseth fosterseth requested a review from pb82 February 4, 2025 06:19
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.30%. Comparing base (a74e730) to head (6b91026).
Report is 2 commits behind head on devel.

✅ All tests successful. No failed tests found.

@fosterseth fosterseth merged commit c2e5425 into ansible:devel Feb 4, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants