dayjs().format()// current date in ISO8601, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'dayjs('2019-01-25').format('[YYYYescape] YYYY-MM-DDTHH:mm:ssZ[Z]')// 'YYYYescape 2019-01-25T00:00:00-02:00Z'dayjs('2019-01-25').format('DD/MM/YYYY')// '25/01/2019'
dayjs 是一个常用的时间操作库。在这里记录一下常用的几个api解析dayjs() // 当前时间dayjs('2020-02-02')dayjs("12-25-1995", "MM-DD-YYYY")dayjs(new Date(2018, 8, 18))加减时间dayjs().add(7, 'day')dayjs().subtract(7, 'year')时间格式化dayjs().format() // current date in ISO8601, without fra