rockMongo时区警告的解决

使用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://www.cnblogs.com/shihao/p/2558324.html