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

Round Excel date to nearest millisecond when converting to javascript date #479

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

bjet007
Copy link
Contributor

@bjet007 bjet007 commented Jan 18, 2018

Hi,

while I was trying to test the generation of our excel file using your library, I found out that some date were not matching what I was expecting.

Opening my file in excel seem to display the correct value, but reloading it with the library and then comparing the excel value to what I was expecting was not always matching. By example writing the following date 2017-11-15T17:00:00.000Z to an excel file and then re-reading it would return 2017-11-15T16:59:59.999Z.

Since excel already round value to the millisecond when showing the value and a javascript date doesn't have precision under a millisecond, I would like to propose that we round the value to the nearest millisecond when reading an excel file.

I haven't found any mention of precision in the spec file, but I think it would be better than truncating the value as it would at least keep the same value when writing and reading a file.

@guyonroche guyonroche merged commit 688937f into exceljs:master Feb 27, 2018
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

Successfully merging this pull request may close these issues.

2 participants