标签:min 时间 get let pre EDA nbsp minutes time
1、将时间戳转换成 2018-12-13 17:35:26
function changeDate(time){ if(!!time){ let getTime = parseInt(time) * 1000; let date = new Date(getTime); let year = date.getFullYear(); let month = parseInt(date.getMonth()) + 1; if(month < 10){ month = "0" + month; } let day = date.getDate(); if(day < 10){ day = "0" + day; } let hours = date.getHours(); if(hours < 10){ hours = "0" + hours; } let minutes = date.getMinutes(); if(minutes < 10){ minutes = "0" + minutes; } let seconds = date.getSeconds(); if(seconds < 10){ seconds = "0" + seconds; } return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; }else{ return ‘‘; } }
标签:min 时间 get let pre EDA nbsp minutes time
原文地址:https://www.cnblogs.com/haishen/p/10115463.html