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;
}

posted @ 2019-06-19 11:09  爱跳舞的程序员  阅读(251)  评论(0编辑  收藏  举报