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

Bug with southern hemisphere and DST #27

Closed
StefanoMagrassi opened this issue Oct 9, 2017 · 4 comments
Closed

Bug with southern hemisphere and DST #27

StefanoMagrassi opened this issue Oct 9, 2017 · 4 comments
Labels

Comments

@StefanoMagrassi
Copy link

It seems that the DST "change" property it's not rightly handled in the southern hemisphere.

For example, if you set as date 2017-10-09 12:00 UTC and go to America/Sao_Paulo timezone, hour() method should return 09:00 because (ref):

  • UTC standard offset is -3;
  • UTC DST offset is -2;
  • DST starts on october 15th

Coherently, if you change date to 2017-10-16 it should return as 10:00.

At this line the dst.change is constantly set to -60, but in the case above it should be +60.

Indeed, the timezone().offsets property returns {base: -240, dst: -180} instead of {base: -180, dst: -120}

Same happens with America/Campo_Grande and America/Cuiaba.

I can't understand if this pattern (inverse of current dst.change) could be applied to every timezone in the southern hemisphere.

Take a look to this repl

@spencermountain
Copy link
Owner

oh hey! duh! you're absolutely right.
man, thank you Stefano.
I should've caught this.
Will fix it pronto.
thanks!

@StefanoMagrassi
Copy link
Author

You're welcome.

Please remember that I'm not 100% sure the pattern could be applied to every southern hemisphere timezone. Should be done further investigations

@spencermountain
Copy link
Owner

hey, have been busy. haven't forgot about this.
Hope to get it at the end of the week.

This was referenced Nov 16, 2017
Merged
@spencermountain
Copy link
Owner

hey! i got this in v2.1.1.

you can see it here matching up with what it oughta be:
image

relevant tests
thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants