Returns information about sunrise/sunset and dusk start/dusk end on January 1, 2013, latitude 31.7667, longitude 35.2333:
<?php$sun_info=date_sun_info(strtotime("2013-01-01"),31.7667,35.2333);foreach ($sun_info as $key=>$val) { echo "$key: " . date("H:i :s",$val) . "<br>"; }?>The date_sun_info() function returns an array containing information about sunrise/sunset and twilight start/dusk end for the specified date and location.
Tip: See the date_sunrise() function, which returns the sunrise time for a specified date and location.
Tip: See the date_sunset() function, which returns the sunset time for a specified date and location.
date_sun_info( timestamp,latitude,longitude);
parameter | describe |
---|---|
timestamp | Required. Specify timestamp. |
latitude | Required. Specify latitude. |
longitude | Required. Specifies longitude. |
Return value: | Returns an array if successful, or FALSE if failed. |
---|---|
PHP version: | 5.1.2+ |