js 中时间相减
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:16 点击:次
var addDate = "获取到你想要的时间";
//注意时间格式是:2012-03-05 11:41:30.910 addDate = new Date(Date.parse(addDate.replace(/\-/g, "/")));
var now = new Date();
var diff = now.getTime() - addDate.getTime();
//判断大于七天 if (addDate == 'NaN' || diff > 0 && diff > 7 * 24 * 60 * 60 * 1000) { art("");
}
摘自 夕诺
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>