【JavaScript】ajax请求的数据返回时间戳使用js处理方案

author:咔咔javascript

wechat:fangkangfkhtml

 

方法:java

function formatDate(now) {
    var year = now.getFullYear(),
    month = now.getMonth() + 1,
    date = now.getDate(),
    hour = now.getHours(),
    minute = now.getMinutes(),
    second = now.getSeconds();
    return year + "-" + month + "-" + date;
    }

调用:code

html+='<td>'+ formatDate(new Date(data1[i]["ue_validTime"]*1000))+'</td>';

 

效果:
orm

相关文章
相关标签/搜索