📜  javascript 比较日期 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:24.350000             🧑  作者: Mango

代码示例6
let myDate = new Date("January 13, 2021 12:00:00");
let yourDate = new Date("January 13, 2021 15:00:00");

if (myDate < yourDate) {
  console.log("myDate is less than yourDate"); // will be printed
}
if (myDate > yourDate) {
  console.log("myDate is greater than yourDate");
}