深圳几点钟天亮 (深圳几点钟天黑)

杭州桑拿 05-02 阅读:17 评论:0

以下表格列出了深圳全年每天的日出日落时间。时间均为北京时间。

$times) {$sunrise = date('H:i', $times['sunrise']);$sunset = date('H:i', $times['sunset']);// 输出表格行echo "";}?> 深圳几点钟天亮 (深圳几点钟天黑)
日期 日出 日落
{$date} {$sunrise} {$sunset}
$sunrise, 'sunset' => $sunset);$date = date('Y-m-d', $timestamp);}return $sunrise_sunset_times;}function get_lat_long($city) {// 获取城市的纬度和经度$lat_long = array();switch ($city) {case 'Shenzhen':$lat_long['lat'] = 22.5461;$lat_long['long'] = 114.0683;break;}return $lat_long;}function sunrise($timestamp, $lat, $long) {// 计算日出时间$zenith = 90.83333333333333;$D2R = 0.017453292519943295;$sinDec = 0.39795 sin(2 $D2R $timestamp / 43200 - 0.016751 sin(2 $D2R $timestamp / 43200));$cosDec = cos(asin($sinDec));$cosH = (cos($zenith $D2R) - $sinDec sin($lat $D2R)) / (cos($lat $D2R) $cosDec);if ($cosH > 1) {$H = 0; // 日出未发生} else if ($cosH < -1) {$H = 24; // 日出未发生} else {$H = acos($cosH) / $D2R;}$H = $H + $long / 15;if ($H < 0) {$H = $H + 24;}if ($H > 24) {$H = $H - 24;}$H = $H 60; // 转换为分钟return $H;}function sunset($timestamp, $lat, $long) {// 计算日落时间$zenith = 90.83333333333333;$D2R = 0.017453292519943295;$sinDec = 0.39795 sin(2 $D2R $timestamp / 43200 - 0.016751 sin(2 $D2R $timestamp / 43200));$cosDec = cos(asin($sinDec));$cosH = (cos($zenith $D2R) - $sinDec sin($lat $D2R)) / (cos($lat $D2R) $cosDec);if ($cosH > 1) {$H = 0; // 日落未发生} else if ($cosH < -1) {$H = 24; // 日落未发生} else {$H = acos($cosH) / $D2R;}$H = $H + $long / 15;if ($H < 0) {$H = $H + 24;}if ($H > 24) {$H = $H - 24;}$H = $H 60; // 转换为分钟return $H;}?>
版权声明

本文仅代表作者观点,不代表杭州桑拿立场。
本文系作者授权发表,未经许可,不得转载。

分享:

扫一扫在手机阅读、分享本文