var rbt = '2014-03-01';
var ret = '2014-03-10';
var t1 = new Date();
var t2 = new Date();
var arrayDate1 = rbt.split("-");
var arrayDate2 = ret.split("-");
t1.setFullYear(arrayDate1[0], arrayDate1[1], arrayDate1[2]);
t2.setFullYear(arrayDate2[0], arrayDate2[1], arrayDate2[2]);
var intDays = parseInt(Math.abs(t2-t1) / 1000 / 60 / 60 / 24);
JS 日期相减
最新推荐文章于 2024-08-27 15:36:53 发布