Home > php教程 > php手册 > 无聊的时候,蛋疼一下-计算日出和日落

无聊的时候,蛋疼一下-计算日出和日落

WBOY
Release: 2016-06-06 19:32:13
Original
1141 people have browsed it

给它所需要的年月日、地理坐标以及时区,你就能看到完美的日出和日落 源码来自:http://www.codepearl.com/files/172.html 只列出来了demo好几个类不一一列举了 无 源码与演示: 源码出处演示出处 require_once("sun.php"); $sun=new sun; //日出 $sunrise=$s

给它所需要的年月日、地理坐标以及时区,你就能看到完美的日出和日落

源码来自:http://www.codepearl.com/files/172.html  

只列出来了demo  好几个类不一一列举了

源码与演示:源码出处 演示出处

无聊的时候,蛋疼一下-计算日出和日落
require_once("sun.php");
 
$sun=new sun;
 
//日出                
$sunrise=$sun->rise(mktime(0,0,0,$month,$d,$year),$timezone,$latitude,$longitude,$zenith);
echo(is_null($sunrise)?" ":date("H:i",$sunrise));
 
//日落                
$sunset=$sun->set(mktime(0,0,0,$month,$d,$year),$timezone,$latitude,$longitude,$zenith);
echo(is_null($sunset)?" ":date("H:i",$sunset));
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template