Syntax
mixed date_sunset ( int $timestamp [, int $format [, float $latitude [, float $longitude [, float $zenith [, float $gmt_offset]]]]] ) |
Definition and Usage
This function returns the sunset time for a given day (specified as a timestamp) and location.
Paramters
Parameter | Description |
---|---|
timestamp | Required. The timestamp of the day from which the sunrise time is taken. |
format | Optional,
Optional. Specifies how to return the result:
|
latitude |
Optional. Specifies the latitude of the location. The latitude defaults to North. If you want to specify a South value, you must pass a negative value.
|
longitude |
Optional. Specifies the longitude of the location. The longitude defaults to East. If you want to specify a West value, you must pass a negative value.
|
zenith | Optional. |
gmt_offset |
Optional. Specifies the difference between GMT and local time in hours.
|
Return Value
Returns the sunrise time in a specified format on success, or FALSE on failure.
Example
Following is the usage of this function:
<?php /* calculate the sunset time for Lisbon, Portugal Latitude: 38.4 North Longitude: 9 West Zenith ~= 90 offset: +1 GMT */ echo("Date: " . date("D M d Y") . "<br />"); echo("Sunrise time: "); echo(date_sunset(time(),SUNFUNCS_RET_STRING,38.4,-9,90,1)); ?> |
This will produce following result:
Date: Tue Jan 24 2006 Sunset time: 18:44 |
No comments:
Post a Comment