http://live.datatables.net/gemotoca/1/edit?html,css,js,output
http://live.datatables.net/gemotoca/1/edit?html,css,js,output

Link to test case:
Debugger code (debug.datatables.net):
Error messages shown:
Description of problem:
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
DateTime is returned by MySQL in seconds only. The Moment function does not recognize this format so how do we present date (only) in a datatable?
Here is the test script ...
http://live.datatables.net/gemotoca/1/edit?html,css,js,output
You can use
columns.render
to convert the date - see here,Colin
It seems that the test case that I post doesn't save the date format MySQL is creating. What you should be seeing at the link.
The same principle applies - you'll just need to give the current moment format in the
columns.render
function. You can check their guide to get that,Colin
Have you looked at this moment.js doc?
https://momentjs.com/docs/#/parsing/unix-timestamp/
Kevin
Why? That's not the default behaviour.
I'm not clear what you're trying to do, but why not have the database return exactly what you want so you don't need to do anything else to the result?
@tangerine The default behavior of WtForms with the MySQL extension DATETIME, is to fill Pandas with this unix date time (in seconds).
All you have to do to get this output in Flask is :
After this, you just need to ajax fetch in to datatable.net to get the UTC in seconds. I assume the pandas date format can be changed as well? Or the reforming can happen in JS via a moment ...
Here are two solutions that seem to work ... from https://stackoverflow.com/questions/33665104/datatables-convert-incoming-epoch-date-to-dd-mm-yyyy
The second routine on stackoverview doesn't rely on moment.js:
For one datefield in a Datatable:
For multiple date fields in a Datatable::
For multiple columns, since the code is the same, you could do this:
Kevin