📜  js 获得秒差 - Javascript 代码示例

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

代码示例2
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);