Date format when export datatable to excel

Date format when export datatable to excel

alogoalogo Posts: 2Questions: 0Answers: 0

In my datatable I have a column with date format but when export to excel the format date change to General then I can´t sort from the most recent date to the oldest date

Replies

  • ApezdrApezdr Posts: 43Questions: 4Answers: 5
  • alogoalogo Posts: 2Questions: 0Answers: 0

    Thank you @Apezdr, but I don't think so, I just need date format in excel. But when export the format is "General" and not "Date"

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    edited March 2017

    Does this answer your question?
    https://datatables.net/forums/discussion/40660

    If not then maybe start with posting your Datatables init code showing the column and buttons definitions.

    Kevin

  • ApezdrApezdr Posts: 43Questions: 4Answers: 5

    Kevin had a closer example to what you're asking about but the answer is the same, you'll have to dig into the customization option of the excelHtml5 button https://datatables.net/reference/button/excelHtml5.

    A helpful hint, its not easy at all to manipulate the excel document generation at length. I'd see if you can just adjust the date format that datatables spits out and see if it fixes your issue.

  • AlviiAlvii Posts: 15Questions: 4Answers: 2

    Hello @alogo, did you find a work around this? I'm having the same issue

  • vidu08vidu08 Posts: 1Questions: 0Answers: 0

    hello,
    When the grid data is exported ,the date columns are exported as "General" datatype. By default this needs to be exported as "Short Date".
    did anyone find a solution for this ?

This discussion has been closed.