update time/api.php.

This commit is contained in:
Bigsk 2020-09-26 13:28:54 +08:00 committed by Gitee
parent a8538eda85
commit 7773d350b9

View File

@ -7,7 +7,6 @@ if($_GET['type']==''){
echo $time;
}elseif($_GET['type']=='date'){
if($_GET['zone']==''){
//服务器时间为东八区,您可以自行修改
$time_gap=$time-(60*60*8)+(60*60*0);
}elseif($_GET['zone']<=12 and $_GET['zone']>=-12){
$time_gap=$time-(60*60*8)+(60*60*$_GET['zone']);
@ -18,6 +17,6 @@ if($_GET['type']==''){
if($error==true){
echo '{"error":10004}';
}else{
echo '{"stamp":'.$time.',"year":'.date("Y",$time_gap).',"month":'.date("m",$time_gap).',"day":'.date("d",$time_gap).',"hour":'.date("H",$time_gap).',"minute":'.date("i",$time_gap).',"second":'.date("s",$time_gap).'}';
echo '{"stamp":'.$time.',"year":'.date("Y",$time_gap).',"month":"'.date("m",$time_gap).'","day":"'.date("d",$time_gap).'","hour":"'.date("H",$time_gap).'","minute":"'.date("i",$time_gap).'","second":"'.date("s",$time_gap).'"}';
}
}