-
Notifications
You must be signed in to change notification settings - Fork 216
Date timezone error #155
Comments
Hi, I am not sure if my issue is the same, but seems pretty same: Can you guys help me out ? |
The best way to guarantee your date string is to send a UTC date string From section 18.17.4.1 of the spec guide
That no timezone information bit the difficult thing because Javascript DateTime objects do have timezone and reconciling the two is not a straight forward task. Using UTC date strings in your code should show everything the way you like. |
Hi,
|
@chk- you're likely to still run into issues with this solution if you live in an area that observes daylight saving time. The date string that gets created will have the offset based on the date that you pass into the function.
You'll probably see that dates created display fine as long as they match the daylight saving period you're currently in, but dates created outside that period will show as an hour off. |
@natergj Thank you for your advise, you're totaly right. So I went deeper and these are the facts I could collect: Now back to the fact, that there is a serious issu with the function getExcelTS. If I use
The cell will show 30.03.2019 23:00:00. (I have UTC +1). This issue I work around by using the prooved and stable function
For situations, where only a date is needed, the "datenum" solution works as expected. For situations, where the cell value must match the time displayed in the app at the user's computer, there still remains the timezone-offset issue. |
@natergj Is it right to say that this is a temporary solution? |
I found the same error and fix it on v1.7 by kind of this solution in setting up the UTC. |
In case anyone else is here because you're seeing date shifts by 1 hour that might be related to daylight savings time changes somehow having an effect on the value UTC timestamps -- that's under discussion at #324. |
Hello, with latest version of the module cell dates are converted not considering the timezone, ie: worksheet.date(7:00+01:00) converts to 6:00. Any help is really appreciated, i'm using strings as a workaround.
Cheers
The text was updated successfully, but these errors were encountered: