I use DateTime in MySQL. So I have something like 2014-10-31 00:00:00
in my database.
From my API, when I return some query, I would normally have to loop through them and convert the DateTime to Timestamp using strtotime()
. Then in JavaScript, I can use it by multiplying this timestamp by a 1000.
However, is there a way I could pass the pure DateTime to Javascript and do all the conversion there?