fromatTime(val){
const data = new Date(val)
const Year = date.getFullYear()
let Month = date.getMonth() + 1
Month = Month < 10? '0' + Month : Month
let Day = date.getDate()
Day = Day < 10? '0' + Day : Day
let Hour = date.getHours()
Hour = Hour < 10? '0' + Hour : Hour
let Minute = date.getMinutes()
Minute = Minute < 10? '0' + Minute : Minute
let Second = date.getSeconds()
Second = Second < 10? '0' + Second : Second
return Year + '-' + Month + '-' + Day + '' + Hour + ':' + Minute + ':' + Second
}
标签:常用,Hour,Month,Second,设置,date,格式,Day,Minute
From: https://www.cnblogs.com/totopian/p/16848186.html