标签:pre java date() class minutes 获取 时间戳 filter filters
filters:{ ordertime(value){ let date = new Date(Number(value)*1000); //转成Number格式,且php获取的时间戳要*1000 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; return y + ‘-‘ + MM + ‘-‘ + d + ‘ ‘ + h + ‘:‘ + m + ‘:‘ + s; } }
在vue.js里 时间戳变换日期格式!
标签:pre java date() class minutes 获取 时间戳 filter filters
原文地址:https://www.cnblogs.com/weilianguang/p/12963895.html