码迷,mamicode.com
首页 > 其他好文 > 详细

时间差计算

时间:2017-05-18 17:54:21      阅读:124      评论:0      收藏:0      [点我收藏+]

标签:time()   开始   return   time   时间差   upd   turn   ret   ==   

  showdaytext : function(time){
var showday = {
"1" : "一天后开始",
"2" : "两天后开始",
"3" : "三天后开始",
};
var upday = new Date(time).getTime() - new Date().getTime();
var hours = Math.abs(Math.floor((upday % (24*3600*1000))/(3600*1000)));
var day = Math.abs(Math.floor(upday/(24*3600*1000)));
if(upday>0) {
if(day==0) {
return 1;
}
if(day==1) {
return 2;
}
if(day==2) {
return 3;
}
}



},

时间差计算

标签:time()   开始   return   time   时间差   upd   turn   ret   ==   

原文地址:http://www.cnblogs.com/csw1364115877/p/6874637.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!