PHP date_default_timezone_set() 函数
PHP 教程
· 2019-01-23 19:28:38
实例
设置默认时区:
date_default_timezone_set("Asia/Shanghai");
echo date_default_timezone_get();
定义和用法
date_default_timezone_set() 函数设置脚本中所有日期/时间函数使用的默认时区。
语法
date_default_timezone_set(timezone);
| 参数 | 描述 |
|---|---|
| timezone | 必需。规定要使用的时区,比如 "UTC" 或 "Europe/Paris"。合法时区的列表: http://www.php.net/manual/en/timezones.php |
技术细节
| 返回值: | 如果 timezone 不合法则返回 FALSE,否则返回 TRUE。 |
|---|---|
| PHP 版本: | 5.1+ |
| 更新日志: | 从 PHP 5.1.2+ 开始,该函数开始验证 timezone 参数。从 PHP 5.3+ 开始,抛出 E_WARNING 而不是 E_STRICT。 |
点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html
About Face 3
Alan Cooper、Robert Reimann、David Cronin / John Wiley & Sons / 2007-5-15 / GBP 28.99
* The return of the authoritative bestseller includes all new content relevant to the popularization of how About Face maintains its relevance to new Web technologies such as AJAX and mobile platforms......一起来看看 《About Face 3》 这本书的介绍吧!
HEX CMYK 转换工具
HEX CMYK 互转工具
HEX HSV 转换工具
HEX HSV 互换工具