I have a js time in milliseconds. How can I convert it to the format:
Day Mon date yyyy UTC GMT e.g Fri Feb 05 2016 00:00:00 GMT+0000 (GMT Standard Time)
Thanks
I have a js time in milliseconds. How can I convert it to the format:
Day Mon date yyyy UTC GMT e.g Fri Feb 05 2016 00:00:00 GMT+0000 (GMT Standard Time)
Thanks
var milliseconds = new Date().getTime(); //Get milliseconds
var date = new Date(milliseconds); // Create date from milliseconds
console.log(date.toString()); //Log: Fri Feb 05 2016 12:41:18 GMT+0200 (EET)
// Let's create futureDate, 5days after now ...
var millisecondsInDay = 8.64e+7; // Milliseconds per day
var futureDate = new Date(milliseconds + 5*millisecondsInDay);
console.log(futureDate.toString()); //Log: Wed Feb 10 2016 12:41:18 GMT+0200 (EET)