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

Timezone issue #617

Open
6 of 7 tasks
AhmedElTabarani opened this issue Mar 4, 2024 · 0 comments
Open
6 of 7 tasks

Timezone issue #617

AhmedElTabarani opened this issue Mar 4, 2024 · 0 comments

Comments

@AhmedElTabarani
Copy link

AhmedElTabarani commented Mar 4, 2024

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)

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

1 participant