@@ 84-90 (lines=7) @@ | ||
81 | * @static |
|
82 | * @return string |
|
83 | */ |
|
84 | public static function getSunriseTime($latitude, $longitude, $timestamp = null, $gmtOffset = null) { |
|
85 | $timestamp = self::checkTimestamp($timestamp); |
|
86 | if (!$gmtOffset) { |
|
87 | $gmtOffset = self::getGmtOffset(); |
|
88 | } |
|
89 | return date_sunrise($timestamp, SUNFUNCS_RET_STRING, $latitude, $longitude, ini_get('date.sunrise_zenith'), $gmtOffset); |
|
90 | } |
|
91 | ||
92 | /** |
|
93 | * Returns sunset time |
|
@@ 101-107 (lines=7) @@ | ||
98 | * @static |
|
99 | * @return string |
|
100 | */ |
|
101 | public static function getSunsetTime($latitude, $longitude, $timestamp = null, $gmtOffset = null) { |
|
102 | $timestamp = self::checkTimestamp($timestamp); |
|
103 | if ($gmtOffset === null) { |
|
104 | $gmtOffset = self::getGmtOffset(); |
|
105 | } |
|
106 | return date_sunset($timestamp, SUNFUNCS_RET_STRING, $latitude, $longitude, ini_get('date.sunrise_zenith'), $gmtOffset); |
|
107 | } |
|
108 | ||
109 | /** |
|
110 | * Calculates and returns current GMT offset |