// 获取当前时间并进行格式化 2020-05-08 10:20:59 export const getNowTime = () => { const time = new Date() let year = () let month = ()+1 let day = () let hour = () let min = () let sec = () month = month<10?`0${month}`:month day = day<10?`0${day}`:day hour = hour<10?`0${hour}`:hour min= min<10 ? `0${min}` : min sec= sec<10 ? `0${sec}` : sec return `${year}-${month}-${day} ${hour}:${min}:${sec}` }