js将时间戳转成时间格式
作者:互联网
let start_time = 1653007401082, date = new Date(+start_time), Y = date.getFullYear() + '-', M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-', D = date.getDate() + ' ', h = date.getHours() + ':', m = date.getMinutes() + ':', s = date.getSeconds() this.start_time = Y + M + D // '2022-05-20'
二,时间格式转换成时间戳方法
let data = new Date().getTime()
标签:Date,new,js,start,转成,time,date,格式,getMonth 来源: https://www.cnblogs.com/anna001/p/16291099.html