KosherDev | Blog about kosher programming

TAG | sunrise

23 Teves 5730 - Окт/09

30

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: 6% [?]

, , , Hide

Find it!

Theme Design by devolux.org