Timezone issue
AhmedElTabarani opened this issue · comments
Reporting an issue
My machine's timezone is Africa/Cairo
And there is daylight saving happen in Africa/Cairo in this window of dates
offset was +3 in 2023-10-26 and +2 in 2023-10-27
const rule = new RRule({
dtstart: datetime(2023, 10, 25),
until: datetime(2023, 10, 29),
interval: 1,
freq: RRule.DAILY,
tzid: 'Asia/Dubai', // i set it to Asia/Dubai (offset is +4)
// if i set it to Africa/Cairo it will return date in UTC
byhour: 9,
});
console.log(rule.all());
Actually:
[
2023-10-25T08:00:00.000Z,
2023-10-26T08:00:00.000Z,
2023-10-27T07:00:00.000Z,
2023-10-28T07:00:00.000Z
]
Expected:
[
2023-10-25T05:00:00.000Z,
2023-10-26T05:00:00.000Z,
2023-10-27T0500:00.000Z,
2023-10-28T05:00:00.000Z
]
I set the tzid
to 'Asia/Dubai'
. but it takes a weird timezone instead of the one I have given in tzid
!
And if i set it to Africa/Cairo
it will return date in UTC
const rule = new RRule({
dtstart: datetime(2023, 10, 25),
until: datetime(2023, 10, 29),
interval: 1,
freq: RRule.DAILY,
tzid: 'Africa/Cairo',
byhour: 9,
});
console.log(rule.all());
Actually:
[
2023-10-25T09:00:00.000Z,
2023-10-26T09:00:00.000Z,
2023-10-27T09:00:00.000Z,
2023-10-28T09:00:00.000Z
]
Expected:
[
2023-10-25T06:00:00.000Z,
2023-10-26T06:00:00.000Z,
2023-10-27T0700:00.000Z,
2023-10-28T07:00:00.000Z
]
-
rrule
version 2.8.1 -
OS: Windows 11
-
My local timezone is Africa/Cairo
-
Verify that you've looked through existing issues for duplicates before
creating a new one -
Code sample reproducing the issue. Be sure to include all input values you
are using such as the exact RRule string and dates. -
Expected output
-
Actual output
-
The version of
rrule
you are using: -
Your operating system
-
Your local timezone (run
$ date
from the command line
of the machine showing the bug)