rrule-go icon indicating copy to clipboard operation
rrule-go copied to clipboard

Invalid timestamps for `HOURLY` interval RRULEs when DST change occurs

Open leaanthony-sc opened this issue 1 year ago • 2 comments

Describe the bug teambition/rrule-go version: v1.8.2

We ran across an issue where RRULEs that use HOURLY intervals return incorrect timestamps when the timestamp corresponds to a DST switch.

Consider the following scenario:

  • DST in Australia/Sydney starts at 2022-10-02 02:00 and the clocks go forward 1 hour. The timezone changes from AEST (+1000) to AEDT (+1100).
  • An hourly schedule starting at 2022-10-02 01:00 with a count of 3, should return the following values:
    • 2022-10-02 01:00:00 +1000 AEST / 2022-10-01 15:00:00 +0000 UTC
    • 2022-10-02 03:00:00 +1100 AEDT / 2022-10-01 16:00:00 +0000 UTC
    • 2022-10-02 04:00:00 +1100 AEDT / 2022-10-01 17:00:00 +0000 UTC
  • What we get is:
    • 2022-10-02 01:00:00 +1000 AEST / 2022-10-01 15:00:00 +0000 UTC
    • 2022-10-02 03:00:00 +1100 AEDT / 2022-10-01 16:00:00 +0000 UTC
    • 2022-10-02 03:00:00 +1100 AEDT / 2022-10-01 16:00:00 +0000 UTC

The same bug can be seen when DST ends on April 2nd 2023.

To Reproduce We have raised a PR to show the bug.

Expected behavior Should return correct hour values.

leaanthony-sc avatar Nov 17 '23 06:11 leaanthony-sc