How to correctly format date to yyyy-mm-dd from xlsx to csv #3013
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#3013
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?
When converting excel files to csv files we would like for all our dates to be formatted the same, like yyyy-mm-dd.
We tried doing this using the dateNF option, but this seems to only work for dates formatted like dd/mm/yyyy.
Is it possible for dateNF to work with other formats? For instance dd-mm-yyyy or dd.mm.yyyy
And if this is not possible with dateNF, is their another way we could do this using sheetjs?
dateNF solves a very specific ambiguity with Excel. Number format 14 must be interpreted according to the computer regional settings. Other formats are specified in a locale-independent way.
If you need to override the format for all date cells:
pass the options
cellDates: true, cellNF: true, cellText: false
to theread
orreadFile
functionloop over every cell and manually set the
z
number format property of each date cell to the desired format.#3019 (comment) related comment with a code snippet for looping over every cell in a sparse worksheet and wiping the
z
number format for each date cell:For a dense worksheet (if you pass
dense: true
toread
orreadFile
) the loop is