date_sunrise
date_sunrise
Returns time of sunrise for a given day and location
Waarschuwing: > This function has been as of PHP 8.1.0. Relying on this function is highly discouraged. Use instead. DEPRECATED
date_sun_info
**date_sunrise** int $timestamp int $returnFormat $latitude $longitude $zenith $utcOffset
returns the sunrise time for a given
day (specified as a ) and location.
date_sunrise``timestamp
timestamp
The of the day from which the sunrise
time is taken.
timestamp
returnFormat
latitude
Defaults to North, pass in a negative value for South.
See also:
date.default_latitude
longitude
Defaults to East, pass in a negative value for West.
See also:
date.default_longitude
zenith
is the angle between the center of the sun
and a line perpendicular to earth's surface. It defaults to
`zenith`date.sunrise_zenith
utcOffset
Specified in hours.
The is ignored, if
is
.
utcOffset``returnFormat``SUNFUNCS_RET_TIMESTAMP
Returns the sunrise time in a specified on
successreturn.falseforfailure. One potential reason for failure is that the
sun does not rise at all, which happens inside the polar circles for part of
the year.
returnFormat
Voorbeeld: example
<?php
/* calculate the sunrise time for Lisbon, Portugal
Latitude: 38.4 North
Longitude: 9 West
Zenith ~= 90
offset: +1 GMT
*/
echo date("D M d Y"). ', sunrise time : ' .date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1);
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 10
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in script on line 10
Mon Dec 20 2004, sunrise time : 08:54
Voorbeeld: No sunrise
<?php
$solstice = strtotime('2017-12-21');
var_dump(date_sunrise($solstice, SUNFUNCS_RET_STRING, 69.245833, -53.537222));
Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 3
Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in script on line 3
bool(false)
date_sun_info