zoukankan      html  css  js  c++  java
  • 关于前台日期转换和比较大小以及今天前三天日期

      var meetingDate = new Date();
          $scope.meetingYear = meetingDate.getFullYear();
          $scope.meetingMonth = meetingDate.getMonth() + 1;
          $scope.meetingDay = meetingDate.getDate();
          $scope.meetingHour = meetingDate.getHours();
          $scope.meetingMinutes = meetingDate.getMinutes();
          $scope.dateStr = meetingDate.getFullYear() + "-" + ((meetingDate.getMonth() + 1) < 10 ? "0" : "") + (meetingDate.getMonth() + 1) + "-" + (meetingDate.getDate() < 10 ? "0" : "") + meetingDate.getDate();

     function formatDate(date) {
             var year = date.getFullYear();
             var month = date.getMonth() + 1;
             var day = date.getDate();
             var hour = date.getHours();
             var minute = date.getMinutes();
             var second = date.getSeconds();
             return year + "-" + formatTen(month) + "-" + formatTen(day);

          }




    $scope.siteNewEndDate = siteEndDate.getFullYear() + "-" + ((siteEndDate.getMonth() + 1) < 10 ? "0" : "") + (siteEndDate.getMonth() + 1) + "-" + (siteEndDate.getDate() < 10 ? "0" : "") + siteEndDate.getDate() +
                " " + ((siteEndDate.getHours() + 1) < 10 ? "0" : "") + (siteEndDate.getHours()) + ":" + ((siteEndDate.getMinutes() + 1) < 10 ? "0" : "") + (siteEndDate.getMinutes());
             var sDate = new Date($scope.siteStartDate.replace(/-/g, '/'));
             var eDate = new Date($scope.siteNewEndDate.replace(/-/g, '/'));

    前三天

     var threeAgo = sitebeginDate.getTime()-3*24*60*60*1000;
          $scope.beginDate = new Date(threeAgo).getFullYear() + "-" + ((new Date(threeAgo).getMonth() + 1) < 10 ? "0" : "") + (new Date(threeAgo).getMonth() + 1) + "-" + (new Date(threeAgo).getDate() < 10 ? "0" : "") + new Date(threeAgo).getDate();


  • 相关阅读:
    鸡兔同笼问题
    猴子吃桃问题
    Fibonacci_sequence(斐波那契数列)
    Joseph_Circle(约瑟夫环)
    学生成绩管理--功能全--较难
    各种排序
    二叉排序树操作--基本
    面向对象程序设计(多继承)--简单
    面向对象程序设计3--简单
    使用 ASR 和 Azure Pack 为 IaaS 工作负荷提供托受管 DR
  • 原文地址:https://www.cnblogs.com/baobeiqi-e/p/9884775.html
Copyright © 2011-2022 走看看