📌  相关文章
📜  js 日期差异以秒为单位 - Javascript 代码示例

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

代码示例4
var t1 = new Date(YYYY, MM, DD, 0, 0, 0, 0);
var t2 = new Date(ZZZZ, NN, EE, 0, 0, 0, 0);
var dif = t1.getTime() - t2.getTime();

var Seconds_from_T1_to_T2 = dif / 1000;
var Seconds_Between_Dates = Math.abs(Seconds_from_T1_to_T2);