//获取当前日期
getDate:function(){
var dateObj=new Date()
this.time=dateObj.toString().split(’ ‘)[4]
this.day=dateObj.toString().split(’ ‘)[2]
this.year=dateObj.toString().split(’ ')[3]
this.month=dateObj.getMonth()
this.weekday=dateObj.getDay()
},
//计算两个日期得差值
DateMinus:function(date1,date2){
//date1:小日期 date2:大日期
//debugger
var sdate = new Date(date1);
var now = new Date(date2);
var days = now.getTime() - sdate.getTime();
var day = parseInt(days / (1000 * 60 * 60 * 24));
var hour = parseInt(days % (1000 * 60 * 60 * 24)/(1000 * 60 * 60));
var min = parseInt(days % (1000 * 60 * 60 * 24)%(1000 * 60 * 60)/(1000 * 60));
var sec = parseInt(days % (1000 * 60 * 60 * 24)%(1000 * 60 * 60)%(1000 * 60)/1000);
hour=hour+day*24
return hour+’:’+min+’:’+sec
}