rockMongo时区警告的解决

发表于: redis/memcached/mongo | 作者: | 日期: 2012/6/01 09:06

使用rockMongo时总是遇到如下警告:


Warning: date_default_timezone_get(): It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting 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 selected ‘UTC’ for ‘8.0/no DST’ instead in C:\mongo\rockmongo\web\rockmongo\app\classes\VarExportor.php on line 166

google了一下,找到如下几种解决方法:

一、在页头使用date_default_timezone_set()设置 date_default_timezone_set(‘PRC’);
二、在页头使用ini_set(‘date.timezone’,’Asia/Shanghai’);
三、修改php.ini。打开php5.ini查找date.timezone 去掉前面的分号修改成为:date.timezone =PRC

我是按照第一种方法解决的,修改之后的VarExportor.php文件头部如下:

date_default_timezone_set(“PRC”);
define(“MONGO_EXPORT_PHP”, “array”);
define(“MONGO_EXPORT_JSON”, “json”);

: https://blog.darkmi.com/2012/06/01/2315.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.