diff --git a/program/include/main.inc b/program/include/main.inc index f6e2ca206..148c2bd5c 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1072,7 +1072,7 @@ function format_date($date, $format=NULL, $convert=true) try { // convert to the right timezone $stz = date_default_timezone_get(); - $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezones') : 'GMT'); + $tz = new DateTimeZone($convert ? $RCMAIL->config->get('timezone') : 'GMT'); $date->setTimezone($tz); date_default_timezone_set($tz->getName()); diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php index e16395711..038336480 100644 --- a/program/include/rcube_config.php +++ b/program/include/rcube_config.php @@ -254,9 +254,13 @@ class rcube_config */ public function get_timezone() { - if ($this->get('timezone')) { - $tz = new DateTimeZone($this->get('timezone')); - return $tz->getOffset(new DateTime('now')) / 3600; + if ($tz = $this->get('timezone')) { + try { + $tz = new DateTimeZone($tz); + return $tz->getOffset(new DateTime('now')) / 3600; + } + catch (Exception $e) { + } } return 0;