I initialize my timestamp variable like
var current_time = new Date();
My output is in Tue Oct 11 2016 15:09:04 GMT+0800 (Malay Peninsula Standard Time) format. How can I change it to 2016-10-11 07:19:48pm format?
I initialize my timestamp variable like
var current_time = new Date();
My output is in Tue Oct 11 2016 15:09:04 GMT+0800 (Malay Peninsula Standard Time) format. How can I change it to 2016-10-11 07:19:48pm format?
you can acheive this using moment.js lib,
just run
moment().format('YYYY-MM-DD hh:mm:SS A'); // print 2016-10-11 03:20:88 PM