01 比較字串中那個日期大

ok


      //比較那個日期大
      function Fun_CompareDateandTime(firstDateString,secondDateString){
        var value=0;
        if ( Date.parse ( firstDateString ) > Date.parse ( secondDateString ) ) {
            // first date is greater
            console.log( "firstDateString big");
            value=1;
        }else if ( Date.parse ( firstDateString ) == Date.parse ( secondDateString ) ) {
            // first date is greater
            value=0;
        }else{
            console.log( "firstDateString small");
            value=-1;
        }
        return value;
      }

Fun_CompareDateandTime("2017-03-13 05:53:22","2018-02-01 04:54:02");
javascript
01 String 字串CH04 ArrayCH05 FormCH05 時間日期Ch10 AJAX