mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-02 01:52:10 +09:00
시간 갭 처리
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3363 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
86bb2bd93b
commit
12053df558
2 changed files with 21 additions and 15 deletions
|
|
@ -211,6 +211,25 @@
|
|||
return preg_match('/.{'.$cut_size.'}/su', $string, $arr) ? $arr[0].$tail : $string;
|
||||
}
|
||||
|
||||
function zgap()
|
||||
{
|
||||
$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;
|
||||
|
||||
$g_min = $t_min - $c_min;
|
||||
$g_hour = $t_hour - $c_hour;
|
||||
|
||||
$gap = $g_min*60 + $g_hour*60*60;
|
||||
return $gap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief YYYYMMDDHHIISS 형식의 시간값을 unix time으로 변경
|
||||
* @param str YYYYMMDDHHIISS 형식의 시간값
|
||||
|
|
@ -227,20 +246,7 @@
|
|||
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;
|
||||
|
||||
$g_min = $t_min - $c_min;
|
||||
$g_hour = $t_hour - $c_hour;
|
||||
|
||||
$gap = $g_min*60 + $g_hour*60*60;
|
||||
$gap = zgap();
|
||||
}
|
||||
|
||||
return mktime($hour, $min, $sec, $month?$month:1, $day?$day:1, $year)+$gap;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue