Skip to content
Browse files

Fixed dates when no-one is logged in (uses server time now, not GMT)

  • Loading branch information...
1 parent 55e078c commit ab24749566f50927b07def0e3899cf7a32708fe5 martin committed
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/moodlelib.php
View
4 lib/moodlelib.php
@@ -340,7 +340,9 @@ function userdate($date, $format="", $timezone=99) {
$format = "%A, %e %B %Y, %I:%M %p";
}
if ($timezone == 99) {
- $timezone = (float)$USER->timezone;
+ if (isset($USER->timezone)) {
+ $timezone = (float)$USER->timezone;
+ }
}
if (abs($timezone) > 12) {
return strftime("$format", $date);

0 comments on commit ab24749

Please sign in to comment.
Something went wrong with that request. Please try again.