var s1 = '2016-6-12'; s1 = new Date(s1.replace(/-/g, "/")); s2 = new Date(); var days = s2.getTime() - s1.getTime(); var time = parseInt(days / (1000 * 60 * 60 * 24));
日期差
最新推荐文章于 2023-05-22 15:46:25 发布
var s1 = '2016-6-12'; s1 = new Date(s1.replace(/-/g, "/")); s2 = new Date(); var days = s2.getTime() - s1.getTime(); var time = parseInt(days / (1000 * 60 * 60 * 24));