Skip to content

Unstable results of running DateFromISODateStringIO in different timezones #121

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

Closed
Nedgeva opened this issue Jul 16, 2020 · 0 comments · Fixed by #122
Closed

Unstable results of running DateFromISODateStringIO in different timezones #121

Nedgeva opened this issue Jul 16, 2020 · 0 comments · Fixed by #122

Comments

@Nedgeva
Copy link
Contributor

Nedgeva commented Jul 16, 2020

Story:
depending on current environment timezone DateFromISODateStringIO (from ts utils) may produce different results when parsing date string.

Steps to reproduce:

  1. set your timezone to PST/PDT
  2. pass ''1999-12-28" date string to DateFromISODateStringIO (or even simplier just run new Date('1999-12-28T00:00:00-07:00'))
  3. actual result is Mon Dec 27 1999 23:00:00 GMT-0800 (because of daylight time compensation: https://en.wikipedia.org/wiki/Pacific_Time_Zone#Daylight_time), while expected result is - Tue Dec 28 1999 00:00:00 ...

  1. set your timezone to UTC +14 Kritimati Island
  2. pass "1985-04-30" date string to DateFromISODateStringIO
  3. actual result is Mon Apr 29 1985 00:00:00 GMT-1000 (because of time zone realignment: https://en.wikipedia.org/wiki/Line_Islands), while expected result is - Tue Apr 30 1985 00:00:00 ...
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

Successfully merging a pull request may close this issue.

1 participant