-
Bug
-
Resolution: Won't Do
-
Major
-
None
-
2.3.9, 2.4.6, 2.5
-
None
-
MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
All date handling in moodlelib.php assumes a timezone > 13
These functions are ones I found that need fixing:
usergetdate(), date_format_string(), make_timestamp(), usertimezone(), usertime()
1.9 codebase example from reporter (but this is still an issue in 2.x)
$usertime = userdate(gmmktime(), get_string('strftimedaydatetime'), "Pacific/Kiritimati" );
echo $usertime yields: "09/10 22:48"
When I use the below code, the time is correctly displayed:
$userDateTime = new DateTime(null, new DateTimeZone("Pacific/Kiritimati"));
$usertime = $userDateTime->format('m/d H:i');
echo $usertime yields: "09/10 16:48"
More discussion on this here:
https://moodle.org/mod/forum/discuss.php?d=237545
- will be (partly) resolved by
-
MDL-49684 Replace custom Moodle timezone stuff with standard PHP date/time code
-
- Closed
-