PHP date_sun_info() Function
PHP Date/Time Reference Manual
Example
Return information about sunrise/sunset and twilight begin/end for January 1, 2013 at latitude 31.7667 and longitude 35.2333:
$val) { echo "$key: " . date("H:i:s",$val) . ""; } ?>
Run Example »
Definition and Usage
The date_sun_info() function returns an array containing information about sunrise/sunset and twilight begin/end for a 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.
Syntax
date_sun_info(
timestamp,latitude,longitude);
| Parameters | Description |
|---|---|
| timestamp | Required. Specifies a timestamp. |
| latitude | Required. Specifies the latitude. |
| longitude | Required. Specifies the longitude. |
Technical Details
| Return Value: | Returns an array on success, or FALSE on failure. |
|---|---|
| PHP Version: | 5.1.2+ |
PHP Date/Time Reference Manual