PHP date_sunrise() Function
PHP Date/Time Reference Manual
Example
Return today's sunrise time in Lisbon, Portugal:
Sunrise time: "); echo(date_sunrise(time(),SUNFUNCS_RET_STRING,38.4,-9,90,1)); ?>Run Example »
Definition and Usage
The date_sunrise() function 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_sunrise(
timestamp,format,latitude,longitude,zenith,gmtoffset);
| Parameters | Description |
|---|---|
| timestamp | Required. Specifies the timestamp of the date for which to calculate the sunrise time. |
| format |
Optional. Specifies how to return the result: |
Technical Details
| Return Value: | On success, returns the sunrise time in the specified format format. Returns FALSE on failure. |
|---|---|
| PHP Version: | 5+ |
| Changelog: | Since PHP 5.1.0, this function raises E_STRICT and E_NOTICE time zone errors. |
PHP Date/Time Reference Manual