PHP Dokumentation: Function date-sun-info
12. Januar 2010 von werner
date_sun_info
(PHP 5 >= 5.1.2)
date_sun_info — Returns an array with information about sunset/sunrise and twilight begin/end
Beschreibung
array date_sun_info ( int $time , float $latitude , float $longitude )
Parameter-Liste
- time
Timestamp.
- latitude
Latitude in degrees.
- longitude
Longitude in degrees.
Rückgabewerte
Returns array on successIm Fehlerfall wird FALSE zurückgegeben..
Beispiele
Beispiel #1 A date_sun_info() example
<?php
$sun_info = date_sun_info(strtotime("2006-12-12"), 31.7667, 35.2333);
foreach ($sun_info as $key => $val) {
echo "$key: " . date("H:i:s", $val) . "\n";
}
?>Das oben gezeigte Beispiel erzeugt folgendeAusgabe:
sunrise: 05:52:11sunset: 15:41:21transit: 10:46:46civil_twilight_begin: 05:24:08civil_twilight_end: 16:09:24nautical_twilight_begin: 04:52:25nautical_twilight_end: 16:41:06astronomical_twilight_begin: 04:21:32astronomical_twilight_end: 17:12:00
Siehe auch
- date_sunrise() – Returns time of sunrise for a given day and location
- date_sunset() – Returns time of sunset for a given day and location