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
Algorithms in C, Parts 1-4
Robert Sedgewick / Addison-Wesley Professional / 1997-9-27 / USD 89.99
"This is an eminently readable book which an ordinary programmer, unskilled in mathematical analysis and wary of theoretical algorithms, ought to be able to pick up and get a lot out of.." - Steve Sum......一起来看看 《Algorithms in C, Parts 1-4》 这本书的介绍吧!