Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ah!! At last, the dreaded off-by-one date bug, squashed.

  • Loading branch information...
commit 70d4cf8267c4345a943f41d0e0fea216decacf32 1 parent 89885b5
moodler authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/moodlelib.php
View
5 lib/moodlelib.php
@@ -152,12 +152,13 @@ function userdate($date, $format="", $timezone=99) {
$datestring = strftime($format, $date);
}
} else {
+ $date = $date + (int)($timezone * 3600);
if ($fixday) {
- $datestring = gmstrftime($formatnoday, $date + (int)($timezone * 3600));
+ $datestring = gmstrftime($formatnoday, $date);
$daystring = str_replace(" 0", "", gmstrftime(" %d", $date));
$datestring = str_replace("DD", $daystring, $datestring);
} else {
- $datestring = gmstrftime($format, $date + (int)($timezone * 3600));
+ $datestring = gmstrftime($format, $date);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.