/**
* 获得当前格林威治时间的时间戳
*
* @return integer
*/
function gmtime()
{
return (time() - date('Z'));
}
看到一个函数的作用是获得当前格林威治时间的时间戳
为什么我echo date('Z') 输出的值是0?
我们不是北京时间吗。date(''Z'')是时区偏移秒数,应该不是0才对
/**
* 获得当前格林威治时间的时间戳
*
* @return integer
*/
function gmtime()
{
return (time() - date('Z'));
}
看到一个函数的作用是获得当前格林威治时间的时间戳
为什么我echo date('Z') 输出的值是0?
我们不是北京时间吗。date(''Z'')是时区偏移秒数,应该不是0才对
按要求说 肯定不是0, 是0 的原因很可能在于的php 配置文件中,你没有设置 时区,你把时区设置成 PRC ,自然就是北京时间,你没有设置时区:那么php 默认执行时间UTC
标准格林威治的时间;你可以通过 date_default_timezone_get () ; 看一下你的当前时区, date_default_timezone_set () ,设置时区.你可以看看手册