diff --git a/libraries/joomla/date/date.php b/libraries/joomla/date/date.php index f26f266bd5f95..db8bc0cb5941a 100644 --- a/libraries/joomla/date/date.php +++ b/libraries/joomla/date/date.php @@ -91,13 +91,13 @@ public function __construct($date = 'now', $tz = null) // If the time zone object is not set, attempt to build it. if (!($tz instanceof DateTimeZone)) { - if ($tz === null) + if (is_string($tz)) { - $tz = self::$gmt; + $tz = new DateTimeZone($tz); } - elseif (is_string($tz)) + else { - $tz = new DateTimeZone($tz); + $tz = self::$gmt; } }