day.js diff 方法详解

在 day.js 中 diff 方法返回指定单位下两个日期时间之间的差异,默认以毫秒为单位,返回值可以为负数。示例一、基础使用默认返回毫秒差异const date1 = dayjs('2022-11-14') const date2 = dayjs('2022-01-25') date1.diff(date2) // ...