function setTime(time) {
var date = new Date();
date.date = Math.floor(time / (1000 * 60 * 60 * 24));
date.hours = Math.floor(( time / (1000 * 60 * 60)) % 24);
date.minutes = Math.floor(( time / (1000 * 60)) % 60);
date.seconds = Math.floor(( time / 1000) % 60);
date.milliseconds = Math.floor(time % 1000);
return date;
}
转载于:https://www.cnblogs.com/LXY02/p/6759350.html