白天和黑夜只交替没交换无法想像对方的世界
分类: oracle
2011-12-19 14:24:57
登录osb管理页面时报时区错误如下:
warning: date() [function.date]: it is not safe to rely on the system's timezone settings. please use the date.timezone setting, the tz environment variable or the date_default_timezone_set() function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we had to select 'utc' because your platform doesn't provide functionality for the guessing algorithm in /apps/oracle/osbackup/apache/htdocs/php/common.php on line 1963
warning: date() [function.date]: it is not safe to rely on the system's timezone settings. please use the date.timezone setting, the tz environment variable or the date_default_timezone_set() function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we had to select 'utc' because your platform doesn't provide functionality for the guessing algorithm in /apps/oracle/osbackup/apache/htdocs/php/common.php on line 1964
warning: date() [function.date]: it is not safe to rely on the system's timezone settings. please use the date.timezone setting, the tz environment variable or the date_default_timezone_set() function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we had to select 'utc' because your platform doesn't provide functionality for the guessing algorithm in /apps/oracle/osbackup/apache/htdocs/php/common.php on line 1965
warning: strftime() [function.strftime]: it is not safe to rely on the system's timezone settings. please use the date.timezone setting, the tz environment variable or the date_default_timezone_set() function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we had to select 'utc' because your platform doesn't provide functionality for the guessing algorithm in /apps/oracle/osbackup/apache/htdocs/php/common.php on line 1966
warning: date() [function.date]: it is not safe to rely on the system's timezone settings. please use the date.timezone setting, the tz environment variable or the date_default_timezone_set() function. in case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. we had to select 'utc' because your platform doesn't provide functionality for the guessing algorithm in /apps/oracle/osbackup/apache/htdocs/php/common.php on line 1968
cause:
这是因为php所取的时间是格林威治标准时间,所以和你当地的时间会有出入格林威治标准时间和北京时间大概差8个小时左右,我们可以按照下面的方法解决。
解决办法:
1、在页头使用date_default_timezone_set()设置我的默认时区为北京时间,即
date_default_timezone_set("prc");
?>就可以了。
2、在php.ini中设置date.timezone的值为prc,设置好以后的为:date.timezone=prc,同时取消这一行代码的注释,即去掉前面的分号就可以了。