Skip to content
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

Reading date from excel gives incorrect output #1725

Closed
techvaib opened this issue Jan 15, 2020 · 3 comments
Closed

Reading date from excel gives incorrect output #1725

techvaib opened this issue Jan 15, 2020 · 3 comments

Comments

@techvaib
Copy link

I am trying to read an excel file and converting it to array/json.
The issue is that the date I am passing in file is read incorrectly and is just off by 10 seconds leading to an incorrect date.
Ex : The date in my file is 10th April, 2018 but the output which i get in date format is Mon Apr 09 2018 23:59:50 GMT+0530 (India Standard Time) (off by 10 seconds leading to one date less than the actual date).

I have tried with multiple combinations of passing parameters from the below parameters

oWorkBook = XLSX.read(bFileData, { type: "binary", cellDates: true, cellStyles: true, dateNF: 'mm-dd-yy', cellText: false });

var stroa = XLSX.utils.sheet_to_row_object_array(oWorkBook.Sheets[sSheetName], { raw: true });
Let me know if I am doing something in an incorrect way.

OutboundShipment.xlsx
Incorrect Date

Thanks,
Vaibhav

@techvaib techvaib changed the title Reading date from excel give incorrect output Reading date from excel gives incorrect output Jan 15, 2020
@SansDK
Copy link

SansDK commented Apr 1, 2020

Same issue here. I don't have Microsoft Excel, but I tested this with

  1. Google Sheets -> export to .xlsx
  2. Google Sheets -> export to .ods
  3. LibreOffice Calc -> export to .ods

This issue only seems to happen in case 1 for some reason.

@techvaib
Copy link
Author

techvaib commented Apr 1, 2020

@lev-cx

Agree that Date conversion depends on local time zone but where are the 10 seconds getting lost leading to an incorrect date.....

@reviewher
Copy link
Contributor

Similar error: #2304

It's a bug in V8 node and chrome https://bugs.chromium.org/p/v8/issues/detail?id=7863

Closing in favor of #1565

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

No branches or pull requests

3 participants