最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 日期时差8小时间解决方法
时间:2011-02-04 编辑:简简单单 来源:一聚教程网
程序中添加时间的初始化语句:“date_default_timezone_set("asia/shanghai");
定义和用法
the date_default_timezone_set() function sets the default timezone used by all date/time functions.
date_default_timezone_set()函数的作用是:设定用于一个脚本中所有日期时间函数的默认时区。
syntax
语法
date_default_timezone_set(timezone) |
parameter 参数 |
description 描述 |
---|---|
timezone | required. the timezone identifier, like "utc" or "europe/paris". list of valid timezones: http://www.php教程.net/manual/en/timezones.php 必要参数,时区确认器,如“utc”或“europe/paris”。下面列出了有效的时区:http://www.php.net/manual/en/timezones.php |
tips教程 and notes
注意点
note: this function always returns true (even if the timezone parameter isn't valid).
注意:这个函数总是返回true(即使时区参数无效的情况下)。
example
案例
the output of the code above will be:
上述代码将输出下面的结果:
-
上一个: php dom读取xml文档代码
-
下一个: php 常用数组应用说明
相关文章
- php时间日期对比与日期加减例子 08-08
- PHP常用的日期和时间总结 10-16
- PHP计算时间段某天是星期几,当前时间后几天及日期时间差 09-04
- php 日期时间相加减 11-21
- PHP中的日期及时间 01-11
- PHP导出数据超时的优化建议解读 10-31