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

Incorrect Africa/Casablanca offset #400

Closed
trzewiczek opened this issue Oct 12, 2023 · 3 comments
Closed

Incorrect Africa/Casablanca offset #400

trzewiczek opened this issue Oct 12, 2023 · 3 comments

Comments

@trzewiczek
Copy link

I've run into a problem with Africa/Casablanca timezone. It presents itself as it was UTC+0:00 while for the given date it should be UTC+1:00.

Please, see example session:

> spacetime.version
'7.4.7'

> spacetime.now('utc').format('{numeric} {time}')
'2023/10/12 9:04am'

> spacetime.now('Africa/Casablanca').format('{numeric} {time}')
'2023/10/12 9:04am'

> spacetime.now('Africa/Casablanca').timezone()
{
  name: 'Africa/Casablanca',
  hasDst: true,
  default_offset: 1,
  hemisphere: 'North',
  current: { offset: 0, isDST: false },
  change: { start: '03/19:03', back: '04/23:02' }
}

The timezone according to Duckduckgo is:

10:04 WEST (UTC+1)
Casablanca, Morocco • Thursday, 12 October 2023

The issue came to light while working with both spacetime and dayjs (in which Africa/Casablanca is UTC+1:00) in one code base.

@simplypixi
Copy link

Same issue here :(

@spencermountain
Copy link
Owner

Thank you, this is helpful. Away from keyboard now, but happy to fix as soon as I'm back

@spencermountain spencermountain mentioned this issue Oct 15, 2023
@spencermountain
Copy link
Owner

okay, i've got a fix for africa/casablanca and africa/el_aaiun for this reversey-dst thing that we somehow never noticed until now.

The change involves setting these 2 iana codes as southern hemisphere, which they're not - but given that it drops an hour, midway through the year, that's how it'll get modelled internally.

If anyone can find other IANA codes that do this, but are in the northern hemisphere, I'd love to know. There's clearly a hole in the tests for this.

released as 7.4.8. let me know if you see any more issues.
cheers

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