MyBB Community Forums

Full Version: Logs/Statistics Time is Wrong
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,

default forum time is correct. Just wondering why my log reports in tools/maintenance is wrong, like 5+ hours.

Thanks !
Time used by your forum can be set in Admin CP->Configuration->Settings->Date and Time Formats
[Image: 001_12072014_065800.jpg]

By default, log reports in Admin CP are using server time and there is no option in MyBB to change it. If you really want as these logs to use a different time, you can edit this core file:
ADMIN_DIR (your administration folder from your MyBB root)/inc/functions.php.
There is a function called "log_admin_action()".

Change this part:
	$log_entry = array(
		"uid" => $mybb->user['uid'],
		"ipaddress" => $db->escape_string(get_ip()),
		"dateline" => TIME_NOW,
		"module" => $db->escape_string($mybb->input['module']),
		"action" => $db->escape_string($mybb->input['action']),
		"data" => $db->escape_string(@serialize($data))
	);
with:
	$log_entry = array(
		"uid" => $mybb->user['uid'],
		"ipaddress" => $db->escape_string(get_ip()),
		"dateline" => TIME_NOW-18000,
		"module" => $db->escape_string($mybb->input['module']),
		"action" => $db->escape_string($mybb->input['action']),
		"data" => $db->escape_string(@serialize($data))
	);
where "-18000" are seconds and are equals with -5 hours (for example).
Thank you so much !! Smile