Lets make it simple.
Have you somehow found yourself wondering what is the best way to store datetime on MySQL, and using it on PHP – JS?
Here what I prefer to do :
Rather than using formatted datetime and have to reformat when you encounter different format, I prefer using unix timestamp.
Javascript has capability to convert date to integer, which return in miliseconds since January 1st, 1970
var d = (new Date()).getTime();
PHP has capability to convert date to integer, which return in seconds since January 1st, 1970
$d = date(‘U’);

