PHPグリニッジ時間相関関数
647 ワード
/**
*
*
* @return integer
*/
function gmtime()
{
return (time() - date('Z'));
}
/**
* GMT
*
* @param string $format
* @param integer $time GMT
*
* @return string
*/
function local_date($format, $time = NULL)
{
$timezone = isset($_SESSION['timezone']) ? $_SESSION['timezone'] : '+8';
if ($time === NULL)
{
$time = gmtime();
}
elseif ($time <= 0)
{
return '';
}
$time += ($timezone * 3600);
return date($format, $time);
}