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
Something is wrong with historical timezone changes. #345
Comments
To make things more complicated, see this page with more details on the change. DST started on that exact date. As a result, on 00:00:00 the clock turned forward 1:40 hour . Maybe the last result should be: |
The same issue applies to other history related timezone changes. On 1937-07-01 the timezone changed from +01:19 to +01:20 in Europe/Amsterdam.
has output
Where i expected
|
Yes, it appears there is something going on here. moment.tz('1940-05-15', 'Europe/Amsterdam').format()
// "1940-05-15T00:00:00+00:20" (correct)
moment.tz('1940-05-15', 'Europe/Amsterdam').startOf('day').format()
// "1940-05-15T00:00:00+00:20" (correct)
moment('1940-05-15T00:00:00Z').tz('Europe/Amsterdam').format()
// "1940-05-15T00:20:00+00:20" (correct)
moment('1940-05-15T00:00:00Z').tz('Europe/Amsterdam').startOf('day').format()
// "1940-05-15T00:00:00+00:20" (correct)
moment.tz('1940-05-16', 'Europe/Amsterdam').format()
// "1940-05-16T01:40:00+02:00" (correct)
moment.tz('1940-05-16', 'Europe/Amsterdam').startOf('day').format()
// "1940-05-16T02:00:00+02:00" (incorrect - should be "1940-05-16T01:40:00+02:00")
moment('1940-05-16T00:00:00Z').tz('Europe/Amsterdam').format()
// "1940-05-16T02:00:00+02:00" (correct)
moment('1940-05-16T00:00:00Z').tz('Europe/Amsterdam').startOf('day').format()
// "1940-05-15T23:20:00+00:20" (incorrect - should be "1940-05-16T01:40:00+02:00") |
Related issues: #327, moment/moment#3132, moment/moment#2749 |
This was fixed in |
Thanks for this, awesome work!
I did however run into an issue: Considers the following code:
Expected output:
Actual output (in latest version):
1940-05-16 is a special date: this day the timezone changed from +00:20 to +02:00, See Wikipeda. It looks like
startOf
doesn't honor the timezone change correctly after being adjusted to the Europe/Amsterdam timezone?The text was updated successfully, but these errors were encountered: