diff --git a/mod/chat/lib.php b/mod/chat/lib.php index 72269cf91b9..7fe83e02a9e 100644 --- a/mod/chat/lib.php +++ b/mod/chat/lib.php @@ -502,6 +502,9 @@ function chat_format_message_manually($message, $courseid, $sender, $currentuser // Use get_user_timezone() to find the correct timezone for displaying this message: // It's either the current user's timezone or else decided by some Moodle config setting + // First, "reset" $USER->timezone (which could have been set by a previous call to here) + // because otherwise the value for the previous $currentuser will take precedence over $CFG->timezone + $USER->timezone = 99; $tz = get_user_timezone($currentuser->timezone); // Before formatting the message time string, set $USER->timezone to the above.