How to convert result from Date.now() to yyyy/MM/dd hh:mm:ss ffff?

You can use the Date constructor which takes in a number of milliseconds and converts it to a JavaScript date:

var d = new Date(Date.now());
d.toString() // returns "Sun May 10 2015 19:50:08 GMT-0600 (MDT)"

In reality, however, doing Date(Date.now()) does the same thing as Date(), so you really only have to do this:

var d = new Date();
d.toString() // returns "Sun May 10 2015 19:50:08 GMT-0600 (MDT)"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)