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)
2
solved convert from milliseconds to date format in javascript [duplicate]