久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長(zhǎng)資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      php如何獲取幾天前時(shí)間

      php獲取幾天前時(shí)間的方法:首先創(chuàng)建一個(gè)php示例文件;然后通過(guò)“date('Y-m-d', strtotime('-7 days'));”方法獲取7天前的時(shí)間;最后使用通過(guò)“strtotime('now'));”方法獲取當(dāng)前的時(shí)間戳即可。

      php如何獲取幾天前時(shí)間

      推薦:《PHP視頻教程》

      $date = date('Y-m-d', strtotime('-7 days')); //保留年-月-日 <?php echo echo date(”Y-m-d H:i:s”,strtotime(”-7 day”)) ;?> //保留年-月-日 時(shí):分:秒 strtotime('-7 days')  獲得的是時(shí)間戳 strtotime('now')); //獲取當(dāng)前的時(shí)間戳 time() //獲取的時(shí)間戳

      php如何獲取幾天前時(shí)間

      擴(kuò)展資料:

      一、使用函式 date() 實(shí)現(xiàn)

      在編輯器中輸入<?php echo $showtime=date("Y-m-d H:i:s");?>,點(diǎn)擊回車就可以得知當(dāng)前的時(shí)間。其中Y是代表4位的年份,H是24小時(shí)制,i 是分鐘,如: "00" 至 "59" 。s -是秒,如: "00" 至 "59" 。

      d 是幾日,二位數(shù)字,若不足二位則前面補(bǔ)零。 如: "01" 至 "31" 。m代表月份,二位數(shù)字,若不足二位則在前面補(bǔ)零,如: "01" 至 "12" 。

      二、使用time函數(shù)

      在編輯器中輸入echo date("y-m-d",$time)點(diǎn)擊回車就可以得知當(dāng)前的時(shí)間,其中Y是代表4位的年份,m代表月份,二位數(shù)字,若不足二位則在前面補(bǔ)零,如: "01" 至 "12" 。d 是幾日,二位數(shù)字,若不足二位則前面補(bǔ)零。 如: "01" 至 "31" 。

      三、使用strftime函數(shù)

      在編輯器中輸入echo strftime ("%hh%m %a %d %b" ,time());點(diǎn)擊回車就可以得知當(dāng)前的時(shí)間。

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號(hào)-2    滬公網(wǎng)安備31011702889846號(hào)