getTime(time) { var y = time.getFullYear() var m = time.getMonth() + 1 m = m < 10 ? '0' + m : m var d = time.getDate() d = d < 10 ? '0' + d : d var h = time.getHours() h = h < 10 ? '0' + h : h var minute = time.getMinutes() minute = minute < 10 ? '0' + minute : minute var second = time.getSeconds() second = second < 10 ? '0' + second : second return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second },
标签:10,格式化,前端,second,时间,time,var,minute From: https://www.cnblogs.com/lh1116/p/17301815.html