js-tools时间处理

//把long值格式为字符串

function dateFormat(longTypeDate){
var dateTypeDate = "";
var date = new Date();
date.setTime(longTypeDate);
dateTypeDate += date.getFullYear(); //年
dateTypeDate += "-" + date.getMonth(); //月
dateTypeDate += "-" + date.getDay(); //日
return dateTypeDate;
}

原文地址:https://www.cnblogs.com/rdchen/p/11050174.html