计算当前日期n天后的日期
作者:互联网
//计算180天后的日期
//180*24*60*60*1000
//更具时间戳计算n天前的日期
$(function () {
var timestamp =Date.parse(new Date());
var tenDayAgo=timestamp-15552000000;
var timeAgo =new Date(tenDayAgo);
var s2=timeAgo.getSeconds();
var yearAgo=timeAgo.getFullYear();
var monthAgo=timeAgo.getMonth()+1;
var dayAge=timeAgo.getDate();
var timeAgo2=yearAgo+"-"+monthAgo+"-"+dayAge alert(timeAgo2)
});
//180*24*60*60*1000
//更具时间戳计算n天前的日期
$(function () {
var timestamp =Date.parse(new Date());
var tenDayAgo=timestamp-15552000000;
var timeAgo =new Date(tenDayAgo);
var s2=timeAgo.getSeconds();
var yearAgo=timeAgo.getFullYear();
var monthAgo=timeAgo.getMonth()+1;
var dayAge=timeAgo.getDate();
var timeAgo2=yearAgo+"-"+monthAgo+"-"+dayAge alert(timeAgo2)
});
标签:timeAgo,60,Date,日期,计算,天后,var,timeAgo2 来源: https://www.cnblogs.com/zhouwen2017/p/11004506.html