How can I convert following date in epoch:
1293683278
to following readable date:
2010-06-23 09:57:58
using Javascript?
Thanks!
How can I convert following date in epoch:
1293683278
to following readable date:
2010-06-23 09:57:58
using Javascript?
Thanks!
You can use moment.js for this.
Code:
Format:
YYYY-MM-DD HH:II:SS
Result:
2010-12-30 07:57:58
Demo: https://jsfiddle.net/NabiKAZ/9ycovfxt/
Note: For current time, just use:
var d = new Date();
instead.See js Date docs for further details
Another way: