/将时间戳转换成时间格式 function dateChange(value,dateFormat) {
let date = new Date(value); let y = date.getFullYear(); let MM = date.getMonth() + 1; MM = MM < 10 ? ('0' + MM) : MM; let d = date.getDate(); d = d < 10 ? ('0' + d) : d; let h = date.getHours(); h = h < 10 ? ('0' + h) : h; let m = date.getMinutes(); m = m < 10 ? ('0' + m) : m; let s = date.getSeconds(); s = s < 10 ? ('0' + s) : s; switch (dateFormat) { case 'yy-mm-dd hh:mm:ss': return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; break; case 'yy-mm-dd': return y + '-' + MM + '-' + d ; break; case 'yy-mm': return y + '-' + MM ; break; case 'hh:mm': return h + ':' + m ; break; case 'yy-mm-dd': return y + '-' + MM + '-' + d ; break; case 'mm-dd': return MM + '月' + d + '日' ; break; default: return MM + '月' + d + '日' ; break; } }