diff --git a/src/bootstrap.php b/src/bootstrap.php index ffa41336..952b695b 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -38,6 +38,10 @@ define('PSM_USER_ADMIN', 10); define('PSM_USER_USER', 20); define('PSM_USER_ANONYMOUS', 30); +if(function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get')) { + date_default_timezone_set(@date_default_timezone_get()); +} + // find config file $path_conf = PSM_PATH_SRC . '../config.php'; if(file_exists($path_conf)) { diff --git a/src/psm/Module/Install/Controller/InstallController.class.php b/src/psm/Module/Install/Controller/InstallController.class.php index 6444641d..f332960f 100644 --- a/src/psm/Module/Install/Controller/InstallController.class.php +++ b/src/psm/Module/Install/Controller/InstallController.class.php @@ -103,6 +103,9 @@ class InstallController extends AbstractController { $errors++; $this->addMessage('The PDO MySQL driver needs to be installed.', 'error'); } + if(!ini_get('date.timezone')) { + $this->addMessage('You should set a timezone in your php.ini file (e.g. \'date.timezone = UTC\'). See this page for more info.', 'warning'); + } if($errors > 0) { $this->addMessage($errors . ' error(s) have been encountered. Please fix them and refresh this page.', 'error');