时间的相加减

时间的相加减:java

在java中能够有这样的:数据库

 Date.prototype.addDays = Date.prototype.addDays || function(days){
this.setDate(this.getDate() + days);
return this;
}ide

//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));this

还能够直接用calendar.data+一个数据;prototype

 

同时在数据库中也能够这样:get

数据库中有函数:it

在数据库中datediff(d,'date1','date2')是两个时间相减(date2-date1);io

在C#中能够把时间转化成时间戳,而后进行相加减。function

Js 中var today=new Date(); // 获取今天时间 today.setDate(today.getDate() + 7);

相关文章
相关标签/搜索