Excel export change dates

Excel export change dates

jgcaudetjgcaudet Posts: 82Questions: 7Answers: 0

My code
[{extend: 'collection',
text: '<i class="far fa-file-excel fa-2x"></i>',
key: {key: 'x', altkey: true},
buttons: [
extend: 'excel',
text: 'Todos',
exportOptions: {columns: ':visible'},
extension : '.xlsx'
extend: 'excel',
text: 'Seleccionados',
exportOptions: {modifier: {selected: true}, columns: ':visible'},
extension : '.xlsx'
}] ;

If I have in a register in my database with a date field with this value '2023/09/20' it exports in my excel this date like '20/09/2023'
But if the register contains a date '2023/09/12' it exports in my excel this date like '09/12/2023' (change day by month when day is 12 or lower)
Can you help me ?


  • allanallan Posts: 60,300Questions: 1Answers: 9,790 Site admin

    Happy to take a look at a test case showing the issue. I'd also suggest you click on the cell in Excel - it can format dates to the locale, which is probably what is happening in the first instance.


Sign In or Register to comment.