2016-02-24, 02:55 PM
The calculation for the "Current Time" language variable in global.php does not appear to be respecting timezones.
I believe it should be
based on the way the function is defined in functions.php, the if will only evaluate true if the $offset is null. When the parameter is not specified, as in global.php, it defaults to 0 and skips the timezone calculation.
I did a quick search on the forums and github and do not see this logged as an issue anywhere. I installed a clean copy of MyBB 1.8.6 to ensure it was not an existing plugin/modification causing the problem.
Edit: On second thought, perhaps the 0 should be null as well in the date calculation so the day flips at the right time.
// Set the current date and time now
$datenow = my_date($mybb->settings['dateformat'], TIME_NOW, 0, false);
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW);
$lang->welcome_current_time = $lang->sprintf($lang->welcome_current_time, $datenow . $lang->comma . $timenow);
I believe it should be
$timenow = my_date($mybb->settings['timeformat'], TIME_NOW, null);
based on the way the function is defined in functions.php, the if will only evaluate true if the $offset is null. When the parameter is not specified, as in global.php, it defaults to 0 and skips the timezone calculation.
if(!$offset && $offset != '0')
I did a quick search on the forums and github and do not see this logged as an issue anywhere. I installed a clean copy of MyBB 1.8.6 to ensure it was not an existing plugin/modification causing the problem.
Edit: On second thought, perhaps the 0 should be null as well in the date calculation so the day flips at the right time.