1
I'm a bit lost on this. The function is below (I got it from XOOPS 2.6)
$time is the time (Unix timestamp).
* The timezone can be set by the locale.php based on the general settings (default locale) for the website.
$timeoffset is the 'user' timezone
* if user. its whats they set in their profile
* if anon. its the 'Default_TZ', from the general settings.
Now there is one more offset, the 'Server_TZ'. That is confusing me.
Looking at the logic that assigns $usertimestamp it looks like it assumes the 'Server_TZ' and $time are using the same timezone. The two time stamps might not always be the same Timezone though. So if they are not the same then the displayed timezone will be off.
When will the $time timezone change timezone:
* using a different locale (because of language)
/**
* @param mixed $time
* @param string $timeoffset
*
* @return int
*/
public function getUserTimestamp($time, $timeoffset = '')
{
if ($timeoffset == '') {
if ($this->isUser()) {
$timeoffset = $this->user->getVar('timezone_offset');
} else {
$timeoffset = $this->getConfig('default_TZ');
}
}
$usertimestamp = intval($time) + (floatval($timeoffset) - $this->getConfig('server_TZ')) * 3600;
return (int)$usertimestamp;
}