PHP5.3 中的Warning: date_default_timezone_set

从PHP5.2升级到PHP5.3后出现警告 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 除了在PHP页面中添加

if(function_exists('date_default_timezone_set'))
   date_default_timezone_set('Asia/Tokyo');

之外, 还可以通过编辑 php.ini, 增加 date.timezone = "America/Anchorage" 这行来实现. 可用的timezone列表在 http://nl3.php.net/manual/en/timezones.php

posted on 2012-03-08 21:18  Milton  阅读(213)  评论(0编辑  收藏  举报

导航