KosherDev | Blog about kosher programming

‍‍30 October 2009 - 12 Cheshvan 5770

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

RSS Feed

(Required)
(Required, will not be published)

<<



Comments on Kosherdev.com are closed for Shabat

You are from

It will be possible to comment after 11 February 18:10

Theme Design by devolux.org