ticket:187 calander error fix. (when zbxe's timzone is different from server's timezone)

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2654 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2007-09-30 12:06:20 +00:00
parent 065e25458b
commit 2cc6c3fd6f
2 changed files with 20 additions and 13 deletions

View file

@ -221,20 +221,27 @@
$month = (int)substr($str,4,2);
$day = (int)substr($str,6,2);
$time_zone = $GLOBALS['_time_zone'];
if($time_zone<0) $to = -1; else $to = 1;
$t_hour = substr($time_zone,1,2)*$to;
$t_min = substr($time_zone,3,2)*$to;
if(strlen($str) < 8)
{
$gap = 0;
}
else
{
$time_zone = $GLOBALS['_time_zone'];
if($time_zone<0) $to = -1; else $to = 1;
$t_hour = substr($time_zone,1,2)*$to;
$t_min = substr($time_zone,3,2)*$to;
$server_time_zone = date("O");
if($server_time_zone<0) $so = -1; else $so = 1;
$c_hour = substr($server_time_zone,1,2)*$so;
$c_min = substr($server_time_zone,3,2)*$so;
$server_time_zone = date("O");
if($server_time_zone<0) $so = -1; else $so = 1;
$c_hour = substr($server_time_zone,1,2)*$so;
$c_min = substr($server_time_zone,3,2)*$so;
$g_min = $t_min - $c_min;
$g_hour = $t_hour - $c_hour;
$gap = $g_min*60 + $g_hour*60*60;
$g_min = $t_min - $c_min;
$g_hour = $t_hour - $c_hour;
$gap = $g_min*60 + $g_hour*60*60;
}
return mktime($hour, $min, $sec, $month?$month:1, $day?$day:1, $year)+$gap;
}