sheet_to_json function changes original date format #2756
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2756
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A user uploads an xlsx document, and one of the columns is a date, and it's displayed as "2022/7/21"
but when sheet_to_json read the xlsx, the data formats will change like this
How to resolve this problem
Thanks
xlsx: ^0.18.5
https://docs.sheetjs.com/docs/csf/features/dates#how-files-store-dates-and-times
The file itself may be using the magical format
m/d/yy
(which is interpreted in different ways depending on the locale).If you want to reformat the dates, pass the option
cellDates: true
to generate date objects, delete thew
fields for date cells and replace them with the format of your choice.At some point we will offer a more general solution