Date not preserved from CSV to XLSX #2740

Open
opened 2022-07-13 09:39:23 +00:00 by LouisDelbosc · 1 comment
LouisDelbosc commented 2022-07-13 09:39:23 +00:00 (Migrated from github.com)

I'm reading some csv data and try to convert it to XLSX. I have a datetime column and it seems the data is not preserved correctly between CSV and XLSX.

I joined some screenshot opened with numebrs and google spread sheet. It is a known issue ? If I use excel will the data be preserved (having a datetime and not a date or just a number) ? Or maybe I did miss an option ? ( I added cellDates: true on reading and writing) ?

Screenshot 2022-07-13 at 11 33 09

CSV

Screenshot 2022-07-13 at 11 33 20

XLSX

Screenshot 2022-07-13 at 11 34 51

import on google spreadsheet

I'm reading some csv data and try to convert it to XLSX. I have a datetime column and it seems the data is not preserved correctly between CSV and XLSX. I joined some screenshot opened with numebrs and google spread sheet. It is a known issue ? If I use excel will the data be preserved (having a datetime and not a date or just a number) ? Or maybe I did miss an option ? ( I added `cellDates: true` on reading and writing) ? <img width="300" alt="Screenshot 2022-07-13 at 11 33 09" src="https://user-images.githubusercontent.com/11460746/178701727-229356c7-4bf2-4c4f-806f-fe31a6104e7f.png"> **CSV** <img width="330" alt="Screenshot 2022-07-13 at 11 33 20" src="https://user-images.githubusercontent.com/11460746/178701734-7275ba4c-c2c3-455e-bc3e-367949c0eb64.png"> **XLSX** <img width="356" alt="Screenshot 2022-07-13 at 11 34 51" src="https://user-images.githubusercontent.com/11460746/178702008-6d211a9f-9810-4cfd-825f-4c57125c5098.png"> **import on google spreadsheet**
rcoundon commented 2022-07-13 09:45:42 +00:00 (Migrated from github.com)

I found similar and ended up (rightly or wrongly) using this function/library to do the conversion

import { getJsDateFromExcel } from 'excel-date-to-js
I found similar and ended up (rightly or wrongly) using this function/library to do the conversion ``` import { getJsDateFromExcel } from 'excel-date-to-js ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2740
No description provided.