时间的相加减:
在java中可以有这样的:
Date.prototype.addDays = Date.prototype.addDays || function(days){
this.setDate(this.getDate() + days);
return this;
}
//Date.prototype.addDays = Date.prototype.addDays || function(days) 防止addDays函数已经在其它地方定义了,
alert("after 3 days:"+new Date().addDays(3));
alert("before 3 days:"+new Date().addDays(-3));
还可以直接用calendar.data+一个数据;
同时在数据库中也可以这样:
数据库中有函数:
在数据库中datediff(d,'date1','date2')是两个时间相减(date2-date1);
在C#中可以把时间转化成时间戳,然后进行相加减。
Js 中var today=new Date(); // 获取今天时间
today.setDate(today.getDate() + 7);
















