【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

相關文章
相關標籤/搜索