xlsx2csv icon indicating copy to clipboard operation
xlsx2csv copied to clipboard

Date formatting ("dates since ...")

Open andrewtweber opened this issue 11 years ago • 4 comments

First, thank you for this amazing library.

The date formatting seems to be really bad though. It converts "4/5/2014" into "04-05-14". This format makes it very hard to convert back into a date. PHP strtotime() interprets it as May 14, 2004. At the very least, the year should be 4 digits, that would help a lot.

Additionally, Excel sometimes stores dates as simply an integer representing the number of days since January 1, 1900 (or January 1, 1904 on Mac for some reason). It would be excellent if those could also be converted to date strings as well.

andrewtweber avatar Feb 19 '14 13:02 andrewtweber

Have you tried --format option? You can specify %d/%m/%Y

dilshod avatar Feb 19 '14 15:02 dilshod

No I had not, sorry! That definitely helps. However, the "days since January 1, 1900" would be a nice feature to have in the future. Thanks.

andrewtweber avatar Feb 19 '14 15:02 andrewtweber

Can you send sample xlsx file? i'll try it

dilshod avatar Feb 19 '14 16:02 dilshod

I have a sample file for the "days since January 1, 1900" issue. See the "Sale Date" column in the following file:https://www.dropbox.com/s/8jn4y8ksmtysfqw/2014.03.14_Entire%20County.xlsx

rickhuizinga avatar May 08 '14 21:05 rickhuizinga