| Index | PHPmyEasyWeather | PHPmyEasyWeather Homepage |
sunRiseSet -- return time of sunrise/sunset for a given date and geographical situation
Array sunRiseSet(int $DAY, int $MONTH, int $YEAR, float $LATITUDE,
string $NS, float $LONGITUDE, string $WE, float $TIMEZONE);
sunRiseSet returns the local time when sun is rising and going down for a given geographical situation. It expects The date in the arguments $DAY, $MONTH and $YEAR, the geographical situation ($LATITUDE and $LONGITUDE) and the timezone related to GMT. $NS indicates weather the latitude is northern (then it has to be "N") or southern ("S"). As $WE it expects either "W" if the longitude is western or "E" for a eastern longitude. Therefore $LATITUDE and $LONGITUDE should be a positive value.
sunRiseSet returns an Array with 4 indexes: "sunrise", "sunset", "risestamp" and "setstamp" which contain the following values:
Use this function instead of getSun if getSun misses some data and returns false.
If the given date is not a valid one, sunRiseSet will return false. It will also return false if the given geographical situation is too near to the pole for the given season. Remember: Near the poles there is no day during wintertimes and no night during summertimes and therefore there canīt be a sunset and a sunrise.
Note: calculating sunrise and sunset times is a complicated procedure depending on a lot of parameters. sunRiseSet uses an approximation technique and therefore the returned results will deviate a few minutes from reality (also daylight saving time is not considered). The used approximation technique is proposed by Dr. Roland Brodbeck (http://www.astronomie.info) who is physicist and astronomer at the University of Zürich in Switzerland.
| Previous | Up | Next |