📅  最后修改于: 2022-03-11 15:01:45.551000             🧑  作者: Mango
// Compare two dates (times) in JS
const ONE_DAY = 86400000;
const today = new Date();
const yesterday = new Date(Number(today) - ONE_DAY);
console.log(yesterday < today); // true