Skip to content
This repository was archived by the owner on Jul 22, 2022. It is now read-only.
This repository was archived by the owner on Jul 22, 2022. It is now read-only.

Date from UTC String off by an hour only on certain dates #324

@n-a-t-e

Description

@n-a-t-e

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.

cell = "2020-03-06T15:38:00Z";

workbook.addWorksheet("My Data").cell(1, 1).date(cell).style({
  numberFormat: "yyyy-mm-dd hh:mm:ss",
});

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:

  • OSX Catalina 10.15.6 Node v12.13.1, excel4node Version: 1.7.2, Microsoft Excel 16.16.27
  • Ubuntu 18.04.2, Node v10.15.1, excel4node Version: 1.7.2, Reading result file with XLSX 0.16.8

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions