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

DST change in Egypt is not taken into account (GMT+2 => GMT+3) #1410

Closed
vsalahkar opened this issue Mar 31, 2023 · 4 comments
Closed

DST change in Egypt is not taken into account (GMT+2 => GMT+3) #1410

vsalahkar opened this issue Mar 31, 2023 · 4 comments

Comments

@vsalahkar
Copy link

Describe the bug
Egypt has announced that they're bringing back DST starting from the last Friday of April this year:
https://egyptianstreets.com/2023/03/01/egypt-brings-daylight-saving-time-back/

We've noticed that the luxon package does not return the correct hour for dates after April 28th

To Reproduce
DateTime.fromISO('2023-05-24 18:20:00+00', { zone: Africa/Cairo })

Actual vs Expected behavior

  • It will return 2023-05-24 20:20:00 (GMT+2)
  • It should return 2023-05-24 21:20:00 (GMT+3)

Desktop (please complete the following information):

  • OS: MacOS
  • Browser Chrome Version 111.0.5563.146
  • Luxon version 3.3.0
  • Your timezone Europe/Paris

Additional context
Moment timezone did the update, see this PR.

Thanks four your answers.

@diesieben07
Copy link
Collaborator

diesieben07 commented Mar 31, 2023

Luxon uses the Browser's time zone data via the Intl API. If this data is not correct, you'll have to report it to the respective browsers.

Edit: You can check if your browser has the correct data with the following code:

let date = new Date(Date.parse('2023-05-24 18:20:00+00'));
let dtf = new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: 'Africa/Cairo'});
console.log(dtf.format(date));

Chrome 111 does indeed not have the correct data (yet).

@vsalahkar
Copy link
Author

Luxon uses the Browser's time zone data via the Intl API. If this data is not correct, you'll have to report it to the respective browsers.

Edit: You can check if your browser has the correct data with the following code:

let date = new Date(Date.parse('2023-05-24 18:20:00+00'));
let dtf = new Intl.DateTimeFormat('en', {dateStyle: 'long', timeStyle: 'long', timeZone: 'Africa/Cairo'});
console.log(dtf.format(date));

Chrome 111 does indeed not have the correct data (yet).

Thanks for your quick answer @diesieben07!

Does it mean every user using my app with any browser must have an up-to-date browser?

It doesn't look scalable to be honest 😅

I'm wondering if I should not switch back to moment-timezone that looks more reliable.

@diesieben07
Copy link
Collaborator

If you want up to date TZ data then yes, the browser must be up to date.
The problem with using moment-timezone (or other libraries that ship their own TZ data, like https://formatjs.io/docs/polyfills/intl-datetimeformat/) is that you have to ship the entire TZ database to the client, which is also "not scalable".

@icambron
Copy link
Member

icambron commented Apr 1, 2023

Yeah, updating your software to include new TZ data every time any zone in the world changes is not a good solution. I recommend relying on the platform.

But, of course, you do you.

@icambron icambron closed this as completed Apr 1, 2023
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

3 participants