码迷,mamicode.com
首页 > Web开发 > 详细

js date

时间:2017-06-09 15:15:18      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:alert   var   date   sage   时间差   比较   参数   ret   time   

 

 

 

   var IssuedTime=new Date(selectRows.IssuedTime);
            //计划下发年月日小时 
            var IssuedYear = IssuedTime.getFullYear();  
            var IssuedMonth = IssuedTime.getMonth()+1;  
            var IssuedDate = IssuedTime.getDate();    
            var IssuedHours = IssuedTime.getHours();  

            var date = new Date();
            //当前时间年月日小时  
            var NowYear = date.getFullYear();  
            var NowMonth = date.getMonth()+1;  
            var NowDate = date.getDate();    
            var NowHours = date.getHours();

//时间比较
   if (IssuedTime < date) {
                $.messager.alert(‘提示信息‘, "已经超过计划发布日期,请确认!");
                return;
            }
         //时间计算

  // 给日期类对象添加日期差方法,返回日期与diff参数日期的时间差,单位为天
                //return (this.getTime() - date.getTime()) / (24 * 60 * 60 * 1000);
                debugger;
                var IssH = (IssuedTime - date) / (60 * 60 * 1000);

  

js date

标签:alert   var   date   sage   时间差   比较   参数   ret   time   

原文地址:http://www.cnblogs.com/lhlong/p/6971710.html

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