日期:2014-05-17  浏览次数:20434 次

基础求教
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable 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 'UTC' for '8.0/no DST' instead in D:\AppServ\www\time.php on line 10
 北京时间:2012-04-11 15;32;57  
表示已经将windows php.int 改到Asia/hong_kong了 怎么还是差8个时差

------解决方案--------------------
PHP code


date_default_timezone_set

(PHP 5 >= 5.1.0)

date_default_timezone_set — 设定用于一个脚本中所有日期时间函数的默认时区


说明

bool date_default_timezone_set ( string $timezone_identifier )

date_default_timezone_set() 设定用于所有日期时间函数的默认时区。 


Note: 

自 PHP 5.1.0 起(此版本日期时间函数被重写了),如果时区不合法则每个对日期时间函数的调用都会产生一条 E_NOTICE 级别的错误信息,如果使用系统设定或 TZ 环境变量则还会产生 E_STRICT 级别的信息。 



参数


timezone_identifier
时区标识符,例如 UTC 或 Europe/Lisbon。合法标识符列表见所支持的时区列表。 



返回值

 如果 timezone_identifier 参数无效则返回 FALSE,否则返回 TRUE。