Is there a way to get sunrise and sunset times in PHP without having to deal with Zenith and GMT offsets?
The functions date_sunrise() and date_sun() asks for zenith and GMT which I don’t want to deal with.
Ideally I would simply write someSunriseFunction(<latitude>, <longitude>, <timezone>)
i.e. someSunriseFunction(34.30, -118.15, 'EST') would be for Los Angeles.
Thanks.
The timezone is pretty useless for this function. That information is already included in the latitude and longitude. What you need is the location and a timestamp, because the sun sets and rises at different times at different times of the year.
And that’s exactly what
date_sun_infogives you: