KosherDev | Blog about kosher programming

Oct 30, 2009 - י"ב חשון תש"ע

Sunset/Sunrise detection in php

During working on a project, which includes zmanim time detection, I investigated proper way to detect sunset and sunrise time.
There are integrated functions date_sunset and date_sunrise.

//detect current time
$ts=mktime();
//latitude and longitude for Daugavpils, Latvia
$lat=56+58/60;
$long=24+8/60
//GMT offset for current location
$gmtoffset=2;
//traditional zenith for detecting zmanim
$zenith=90+50/60;
$today=date_sunset($ts, SUNFUNCS_RET_STRING, $lat, $long, $zenith, $gmtoffset);

This function will return value in the view HH:MM.

Popularity: 12% [?]

RSS Feed

No Comments

(Required)
(Required, will not be published)

<<

Find it!

Theme Design by devolux.org