示例#1
0
文件: header.php 项目: javinc/loadavg
$max = date('Y-m-d');
if (isset($_GET['logdate']) && !empty($_GET['logdate']) && $_GET['logdate'] !== date('Y-m-d')) {
    $min = $_GET['logdate'];
    $max = $_GET['logdate'];
}
if (isset($_GET['minDate']) && !empty($_GET['minDate']) && isset($_GET['maxDate']) && !empty($_GET['maxDate'])) {
    $min = $_GET['minDate'];
    $max = $_GET['maxDate'];
}
$min = strtotime($min);
$max = strtotime($max);
//timezone is taken from the server and UTC offset is recorded for normalization
//client timezone is used to offset browser via javascript only...
$phptimezone = date_default_timezone_get();
//normalize all server time to UTC
$timeoffset = LoadUtility::get_timezone_offset($phptimezone, 'UTC');
if ($timeoffset > 0) {
    $timeoffset = $timeoffset / (60 * 60);
} else {
    $timeoffset = 1;
}
?>

	///////////////////////////////////////////////////

	var today_min_php = <?php 
echo gmmktime(0, 0, 0, date("n", $min), date("j", $min), date("Y", $min)) * 1000;
?>
;	
	var today_max_php = <?php 
echo gmmktime(24, 0, 0, date("n", $max), date("j", $max), date("Y", $max)) * 1000;