-
Notifications
You must be signed in to change notification settings - Fork 216
Date from UTC String off by an hour only on certain dates #324
Comments
I believe the problem is related to daylight savings time changes, in the machine's local timezone, even though that shouldn't affect UTC dates. Here's my setup, using excel4node 1.7.2:
The I've stepped through getExcelTS in my debugger, and the hour gets added on line 143: |
When I change line 143 (and line 150, which is identical) to the following, to add exactly 24 hours rather than "1 date" to
I'm not sure exactly what the full intention of these two lines are (i.e. why days need to be added at all) so it's possible this fix for my problem breaks other edge cases, but at least it's a place to start. |
On certain dates, a UTC time from a string is showing up an hour off. I am in the Pacific time zone, but am using UTC in hopes to avoid PDT/PST time change issues.
https://gist.github.com/n-a-t-e/504737fc250ed9e515daeaea50322dae
Here are the dates I have tried and found to be off by an hour:
These are off:
"2020-03-06T15:38:00Z"
"2020-03-07T19:59:54.000Z"
These work fine:
"2020-03-01T15:38:00Z"
"2020-03-16T15:38:00Z"
"2019-03-06T15:38:00Z"
I tried two different environments with the same results:
Thanks!
The text was updated successfully, but these errors were encountered: