Can't Export UTC Date Strings #2810
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#2810
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?
There is no option to export date strings as UTC. I want my Excel spreadsheet dates to all be UTC dates. Using
aoa_to_sheet
and adateNF
of"YYYY/MM/DD HH::mm::ss"
will always export the date object as a local time string.How do I export UTC date strings with
aoa_to_sheet
?Excel has no support for absolute time. See https://docs.sheetjs.com/docs/csf/features/dates#relative-epochs for more details.
For the described problem, it is strongly recommended to convert Date objects to strings before using aoa_to_sheet:
If you want that specific format, you can use native methods like
getUTCDate
To close out this issue, the parts of the string can be generated as follows: