久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放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. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      為什么php獲取的時(shí)間不一樣?

      在php中獲取時(shí)間是很常見的操作,有時(shí)我們測試程序會發(fā)現(xiàn)獲取的時(shí)間是不一樣的,這是什么原因呢?又該如何解決呢?下面我們一起來看下php獲取的時(shí)間不一樣的解決方法吧。

      為什么php獲取的時(shí)間不一樣?

      為什么php獲取的時(shí)間不一樣?

      使用PHP獲取時(shí)間,發(fā)現(xiàn)時(shí)間不對,這是因?yàn)镻HP默認(rèn)的時(shí)區(qū)是UTC,世界協(xié)調(diào)時(shí)間(Universal Time Coordinated,UTC)。解決方法是設(shè)置時(shí)間為北京時(shí)間。

      具體操作方法如下:

      方法一:修改php.ini文件

      (1)打開php.ini文件

      (2)查找date.timezone,找到date.timezone ="UTC",

      (3)將其改為date.timezone ="PRC",若date.timezone左邊有分號,要將該分號去掉。

      (4)在php程序中測試,輸入下面代碼

      <span class="cur_time"><?php echo "當(dāng)前時(shí)間:" . date("Y-m-d H:i:s") ?></span>

      方法二:使用date_default_timezone_set('')方法

      (1)在php程序開頭加上下面代碼

      <?php date_default_timezone_set('PRC');  echo date("Y-m-d H:i:s"); ?>

      相關(guān)文章教程推薦:php教程

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