📜  JS 获取最小日期 - Javascript 代码示例

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

代码示例1
let maxDate = new Date(8640000000000000);
let minDate = new Date(-8640000000000000);

console.log(new Date(maxDate.getTime()).toString());
console.log(new Date(maxDate.getTime() - 1).toString());
console.log(new Date(maxDate.getTime() + 1).toString()); // Invalid Date

console.log(new Date(minDate.getTime()).toString());
console.log(new Date(minDate.getTime() + 1).toString());
console.log(new Date(minDate.getTime() - 1).toString()); // Invalid Date