久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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í)間格式如何轉(zhuǎn)化

      php時(shí)間格式如何轉(zhuǎn)化

      php時(shí)間格式轉(zhuǎn)化

      php時(shí)間格式的轉(zhuǎn)換函數(shù)有date(),strtotime()函數(shù),php 原生的時(shí)間類(lèi)也可以轉(zhuǎn)換時(shí)間格式。

      1、Y-m-d轉(zhuǎn)換為時(shí)間戳 例:2017-08-22 轉(zhuǎn)化為時(shí)間戳 strtotime(‘2017-08-22’);

      2、時(shí)間戳轉(zhuǎn)換為Y-m-d H:i:s date("Y-m-d H:i:s",strtotime('2017-08-22'));

      3、時(shí)間Ymd格式轉(zhuǎn)化為Y-m-d date(“Y-m-d”,strtotime("20170822"));

      用原生php類(lèi)也可以直接轉(zhuǎn)換 var_dum(DateTime::createFromFormat('Ymd','20170822')->format('Y-m-d'));

      4、獲取當(dāng)前時(shí)間戳:1、time(); 2、date('U');

      5、明天的時(shí)間格式 date("Y-m-d H:i:s",strtotime(+1 day));

      獲取一段時(shí)間的日期

      $end = new DateTime($end); $end = $end->modify( '+1 day' ); $interval = new DateInterval('P1D');// yii中引用原生的php類(lèi)加,因?yàn)橛忻臻g $daterange = new DatePeriod($start, $interval ,$end);//查詢(xún)這個(gè)時(shí)間段內(nèi)所有的日期 foreach($daterange as $date){     $single_date = $date->format("Ymd");//每個(gè)日期都改成20170022的格式     $this->run_curl($url,$post_data,$project,$flow,$single_date,$timeBegin,$timeEnd); }

      $datarange就是時(shí)間段內(nèi)的日期。

      推薦:《PHP教程》

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