TShopping

 找回密碼
 註冊
搜索
查看: 1947|回復: 0
打印 上一主題 下一主題

[分享] 設定地區時間date_default_timezone_set()

[複製鏈接]
跳轉到指定樓層
1#
發表於 2010-6-8 12:16:25 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
 
Push to Facebook
使用 nginx + php-fpm 測試 phpinfo() 時....發現了底下這個warning 訊息...
Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing' for 'CST/8.0/no DST' instead in /var/www/test.php on line 2

查了一下...加上用 date_default_timezone_set()...果然就可以了
<?php
  date_default_timezone_set("Asia/Taipei");
  echo strftime("%Y-%m-%d %H:%M:%S");
?>

 

臉書網友討論
*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-4-30 10:23 , Processed in 0.039218 second(s), 18 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表