<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                php 獲取今日、昨日、上周、本月的起始時間戳和結束時間戳的方法,主要使用到了 php 的時間函數 mktime。下面首先還是直奔主題以示例說明如何使用 mktime 獲取今日、昨日、上周、本月的起始時間戳和結束時間戳,然后在介紹一下 mktime 函數作用和用法。 ``` //php獲取今日開始時間戳和結束時間戳 $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y')); $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1; //當天開始時間 $starttime=strtotime(date("Y-m-d",time())); $endtime=$starttime+86400; //php獲取昨日起始時間戳和結束時間戳 $beginYesterday=mktime(0,0,0,date('m'),date('d')-1,date('Y')); $endYesterday=mktime(0,0,0,date('m'),date('d'),date('Y'))-1; //php獲取上周起始時間戳和結束時間戳 $beginLastweek=mktime(0,0,0,date('m'),date('d')-date('w')+1-7,date('Y')); $endLastweek=mktime(23,59,59,date('m'),date('d')-date('w')+7-7,date('Y')); //php獲取本月起始時間戳和結束時間戳 $beginThismonth=mktime(0,0,0,date('m'),1,date('Y')); $endThismonth=mktime(23,59,59,date('m'),date('t'),date('Y')); //php獲取上月起始時間戳和結束時間戳 $begintime = strtotime('-1 month', strtotime(date('Y-m', time()) . '-01 00:00:00')); $endtime=strtotime(date('Y-m', time()) . '-01 00:00:00')-1; ``` PHP mktime() 函數用于返回一個日期的 Unix 時間戳。 語法 mktime(hour,minute,second,month,day,year,is\_dst) | 參數 | 描述 | | --- | --- | | hour | 可選。規定小時。 | | minute | 可選。規定分鐘。 | | second | 可選。規定秒。 | | month | 可選。規定用數字表示的月。 | | day | 可選。規定天。 | | year | 可選。規定年。在某些系統上,合法值介于 1901 - 2038 之間。不過在 PHP 5 中已經不存在這個限制了。 | | is\_dst | 可選。如果時間在日光節約時間(DST)期間,則設置為1,否則設置為0,若未知,則設置為-1。 自 5.1.0 起,is\_dst 參數被廢棄。因此應該使用新的時區處理特性。 | 用法 參數總是表示 GMT 日期,因此 is\_dst 對結果沒有影響。 參數可以從右到左依次空著,空著的參數會被設為相應的當前 GMT 值。 注意在 PHP 5.1 之前,如果該函數的參數非法,則會返回 false。 另外需要注意的是該函數對于日期運算和驗證非常有用。它可以自動校正越界的輸入,如: 1echo(date("M-d-Y",mktime(0,0,0,12,36,2001))); 將輸出結果如: Jan-05-2002
                  <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>

                              哎呀哎呀视频在线观看