hhurz / tableExport.jquery.plugin

jQuery plugin to export a html table to JSON, XML, CSV, TSV, TXT, SQL, Word, Excel, PNG and PDF
MIT License
984 stars 714 forks source link

Dates in xlsx, sometimes show previous day #288

Closed wonderiuy closed 4 years ago

wonderiuy commented 4 years ago

Hi hhurz, with this code happens something strange with dates, in specific on the webpage is shown the correct date while in exported xlsx file the dates (not all of them) has one day less (01/04/2008 is exported as 31/03/2008) I'm with dd/mm/yyyy date format thank to you :) see attached image and attached code. Can you plese suggest a workaround or what to do in this case? Can you replicate it? Untitled-1

test.txt

In this example, 2 of 4 dates are correc while the other 2 are exported 1 day before. It seems that after treating 1 or 2 dates, all the rest is diminished by 1 day, unless next row which reset this wrong behaviour Using Version 1.10.14

hhurz commented 4 years ago

Hi, thanks for reporting this issue and for providing detailed information about it. I think the wrong dates where caused because dates were not exported as utc dates, which leaded to the time shifts after excel interpreted the xlsx file.

wonderiuy commented 4 years ago

Fantastic, supreme. Did I told you are the best here around? Thank you again :)