Skip to content

Commit

Permalink
Catch possible Exceptions with timezones
Browse files Browse the repository at this point in the history
  • Loading branch information
JN-Jones committed Jun 20, 2015
1 parent 9ecc730 commit d3fc5fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions resources/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -978,8 +978,12 @@ function get_time_format($format, $add='')
// Converts a String timezone (Europe/Berlin) to a MyBB number
function get_timezone($zone)
{
$time = new DateTime('now', new DateTimeZone($zone));
$off = $time->format('P');
try {
$time = new DateTime('now', new DateTimeZone($zone));
$off = $time->format('P');
} catch(Exception $e) {
return '';
}

list($h, $m) = explode(":", $off);

Expand Down

0 comments on commit d3fc5fd

Please sign in to comment.