<!DOCTYPE html>
<html>
<body>

<?php
//计算中国上海的日出时间
//维度:北纬 31.22
//经度:西经 121.47
//Zenith ~= 90
//offset: +8 GMT

echo("<h2>上海,中国</h2>");
echo("日期:" . date("D M d Y"));
echo("<br>日出时间:");
echo(date_sunrise(time(),SUNFUNCS_RET_STRING,31.22,121.47,90,8));
echo("<br>日落时间:");
echo(date_sunset(time(),SUNFUNCS_RET_STRING,31.22,121.47,90,8));
?>

</body>
</html>