Skip to content

Commit

Permalink
Merge pull request #6926 from bembelimen/patch-5
Browse files Browse the repository at this point in the history
Prevent notice with unset timezone while formatting a date
  • Loading branch information
rdeutz committed Oct 27, 2015
2 parents 88ab251 + bc71688 commit 4672162
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/joomla/date/date.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ public function format($format, $local = false, $translate = true)
}

// If the returned time should not be local use GMT.
if ($local == false)
if ($local == false && !empty(self::$gmt))
{
parent::setTimezone(self::$gmt);
}
Expand Down Expand Up @@ -319,7 +319,7 @@ public function format($format, $local = false, $translate = true)
}
}

if ($local == false)
if ($local == false && !empty($this->tz))
{
parent::setTimezone($this->tz);
}
Expand Down

0 comments on commit 4672162

Please sign in to comment.