<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ~~~ <?php class DateHandle{ //常用處理 public function test(){ //獲取當前時間,字符串型 $date = date('Y-m-d H:i:s',time()); //獲取5天前的時間 $date = date("Y-m-d H:i:s",strtotime("-5 day",strtotime($date))); //字符串時間減一個月(下面的三種形式都有問題) //每月31天的時候最后一天獲取上個月失敗,返回的還是12月 $date = date("Y-m",strtotime("-1 month",strtotime($date))); $date = date('Y-m',strtotime('2017-12-31 -1 month')); $date = date('Y-m',strtotime("-1 month")); //以下是正確形式 $date = date('Y-m',strtotime(date('Y-m-01',strtotime("2017-12-31")).' -1 month')); //直接取當前時間的上一個月 $date = date('Y-m',strtotime(date('Y-m-01',time()).' -1 month')); } /** * 1.獲取開始時間到當前時間的所有月份 * 返回值,包含$start_time,包含當前月 * $start_time,格式:Y-m */ public function getMonths($start_time){ if(empty($start_time)) return []; $end_time = date("Y-m",time()); $months[] = $start_time; if($end_time == $start_time ){ return $months; }else{ if($start_time>$end_time){ return []; }else { $i = 1; while (true){ $tt = date("Y-m",strtotime("+".$i." month",strtotime($start_time))); $months[] = $tt; if($tt == $end_time){ break; } $i++; } } return $months; } } /** * 獲取兩個日期之間的時間月份間隔 * @param $date1 * @param $date2 * @return number */ function getMonthNum($date1,$date2){ if(strtotime($date1)>=strtotime($date2)){ return 0; } list($date_1['y'],$date_1['m'])=explode("-",date('Y-m',strtotime($date1))); list($date_2['y'],$date_2['m'])=explode("-",date('Y-m',strtotime($date2))); return abs($date_1['y']-$date_2['y'])*12 +($date_2['m']-$date_1['m']); } } ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看