date_default_timezone_set

(PHP 5 >= 5.1.0RC1)

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

说明

bool date_default_timezone_set ( string timezone_identifier )

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

注: 自 PHP 5.1.0 起(此版本日期时间函数被重写了),如果时区不合法则每个对日期时间函数的调用都会产生一条 E_NOTICE 级别的错误信息。

参数

timezone_identifier

时区标识符,例如 UTCEurope/Lisbon

返回值

本函数永远返回 TRUE(即使 timezone_identifier 参数不合法)。


add a note add a note User Contributed Notes
There are no user contributed notes for this page.