GMT时间比北京时间慢8小时
1. dayjs
import dayjs from 'dayjs'
dateFormat () (value: Parameters<typeof dayjs>[0],format = 'YYYY-MM-DD HH:mm:ss') => (value ? dayjs(value).format(format) : '')`
2. new Date
timeDate(time){return new Date(time) // time 必须是字符串}就转成中国标准时间了,需要转YYYY-MM-DD HH:mm:ss这种格式在处理一下
3. Date.parse
timeToTimestamp(time){return Date.parse(time) // time 必须是字符串}转成时间戳,在通过时间戳转成YYYY-MM-DD HH:mm:ss
记录一下。