关于javascript:dayjs计算差值

38次阅读

共计 252 个字符,预计需要花费 1 分钟才能阅读完成。

装置

yarn add dayjs -D

应用

dayjs(endTime).diff(dayjs(startTime), 'years')
dayjs(endTime).diff(dayjs(startTime), 'months')
dayjs(endTime).diff(dayjs(startTime), 'days')
dayjs(endTime).diff(dayjs(startTime),'minutes')
dayjs(endTime).diff(dayjs(startTime), 'seconds')

正文完
 0