|
发表于 2020-3-7 12:00:01
|
显示全部楼层
把日期转换成长整型,然后进行比较
你也可以扩展Date类
如
/** Constants used for time computations */
Date.SECOND = 1000 /* milliseconds */;
Date.MINUTE = 60 * Date.SECOND;
Date.HOUR = 60 * Date.MINUTE;
Date.DAY = 24 * Date.HOUR;
Date.WEEK = 7 * Date.DAY; |
|