久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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í)間 date函數(shù)

      本篇文章給大家介紹一下PHP格式化顯示時(shí)間 date() 函數(shù)的方法。有一定的參考價(jià)值,有需要的朋友可以參考一下,希望對(duì)大家有所幫助。

      PHP如何格式化顯示時(shí)間 date函數(shù)

      date() 函數(shù)

      功能:用于格式化時(shí)間,返回一個(gè)字符串。

      語(yǔ)法:string date( string format [, int timestamp] ),其中參數(shù) format 表示時(shí)間格式化的方式;可選參數(shù)timestamp表示時(shí)間戳,默認(rèn)為time(),即當(dāng)前時(shí)間。

      時(shí)間格式化的方式

      PHP如何格式化顯示時(shí)間 date函數(shù)

      例子一

      <?php $date=date_create("2016-09-25"); echo date_format($date,"Y/m/d H:i:s"); ?>

      例子二

      date("Y-m-d",time());       //顯示格式如 2008-12-01 date("Y.m.d",time());       //顯示格式如 2008.12.01 date("M d Y",time());       //顯示格式如 Dec 01 2008 date("Y-m-d H:i",time());   //顯示格式如 2008-12-01 12:01

      date_default_timezone_set('PRC');

      $start_time="2017-3-22 17:00:00";//開(kāi)始考試時(shí)間

      echo $start_time."<br>";

      $mm=60*60;//PHP的時(shí)間是按秒算的

      echo date("Y-m-d H:i:s",strtotime($start_time)+$mm);

      如果輸出的時(shí)間和實(shí)際時(shí)間差8個(gè)小時(shí)(假設(shè)采用的北京時(shí)區(qū))的話(huà),檢查php.ini文件,做如下設(shè)置:date.timezone = PRC

      推薦學(xué)習(xí):php視頻教程

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