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

Wrong Date - export json to sheet #2160

Closed
silverio opened this issue Oct 28, 2020 · 2 comments
Closed

Wrong Date - export json to sheet #2160

silverio opened this issue Oct 28, 2020 · 2 comments

Comments

@silverio
Copy link

Hi,

I am getting the wrong date when exporting json -> sheet. Any Ideas why this is happening?
The date in the object is Tue Sep 01 2020 00:00:00 GMT-0500 (Colombia Standard Time).
But when I export it to excel, I get 8/31/2020 11:59:44 PM.

const test = [{
date: new Date(2020,8,1)
}]

var ws = XLSX.utils.json_to_sheet(test);
var wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, "issue1052");
XLSX.writeFile(wb, "test.xlsx"); ``
@SheetJSDev
Copy link
Contributor

Thanks for sharing!

tz database has the following info for America/Bogota, the IANA time zone for COT:

# Zone	NAME		STDOFF	RULES	FORMAT	[UNTIL]
Zone	America/Bogota	-4:56:16 -	LMT	1884 Mar 13
			-4:56:16 -	BMT	1914 Nov 23 # Bogotá Mean Time
			-5:00	CO	-05/-04

The 16 second difference you are seeing is possibly explained by https://bugs.chromium.org/p/v8/issues/detail?id=7863 -- Chrome is not properly honoring the seconds of the timezone offset in the same way as your system.

@SheetJSDev
Copy link
Contributor

Issue is not fixed, but we're trying to combine similar issues. 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

2 participants