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();


  • 相关阅读:
    ExecuteScalar requires the command to have a transaction when the connection assigned to the command is in a pending
    如何从vss中分离程序
    String or binary data would be truncated
    the pop3 service failed to retrieve authentication type and cannot continue
    The POP3 service failed to start because
    IIS Error he system cannot find the file specified _找不到页面
    pku2575Jolly Jumpers
    pku2940Wine Trading in Gergovia
    pku3219二项式系数
    pku1029false coin
  • 原文地址:https://www.cnblogs.com/baobeiqi-e/p/9884775.html
Copyright © 2011-2022 走看看