包含标签 dayjs 的所有文章
-
day.js diff 方法详解
在day.js中diff方法返回指定单位下两个日期时间之间的差异,默认以毫秒为单位,返回值可以为负数。示例一、基础使用默认返回毫秒差异constdate1=dayjs('2022-11-14')constdate2=dayjs('2022-01-25')date1.diff(date2)//25315200000date2.diff(date1)//-253...
在day.js中diff方法返回指定单位下两个日期时间之间的差异,默认以毫秒为单位,返回值可以为负数。示例一、基础使用默认返回毫秒差异constdate1=dayjs('2022-11-14')constdate2=dayjs('2022-01-25')date1.diff(date2)//25315200000date2.diff(date1)//-253...