fallback to UTC if no timezone setting is available

This commit is contained in:
Roland Gruber 2015-07-06 19:36:29 +00:00
parent bf6872fefa
commit 81eefdd60f
1 changed files with 3 additions and 0 deletions

View File

@ -1276,6 +1276,9 @@ function getTimeZoneOffsetHours() {
* @return DateTimeZone time zone * @return DateTimeZone time zone
*/ */
function getTimeZone() { function getTimeZone() {
if (empty($_SESSION['config'])) {
return new DateTimeZone('UTC');
}
$timeZone = $_SESSION['config']->getTimeZone(); $timeZone = $_SESSION['config']->getTimeZone();
return new DateTimeZone($timeZone); return new DateTimeZone($timeZone);
} }