Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to use date_sunrise() and date_sunset() functions in my php5  

I use them as follows:

$sr = date_sunrise($i,SUNFUNCS_RET_TIMESTAMP,39.2155,-89.2177);
$ss = date_sunset($i,SUNFUNCS_RET_TIMESTAMP,39.2155,-89.2177);

The zenith is whatever the php default is set to (90.58...).

The problem I am having is that the resulting times given are about 20  
minutes later than they should be (according to ).

What am I doing wrong?

Re: sunrise/sunset

Quoted text here. Click to load it

 Not sure, I get almost the same figures.

 PHP says sunrise/sunset, UTC:

Fri, 06 Oct 2006 11:58:16 +0000
Fri, 06 Oct 2006 23:31:19 +0000

 The site above for the same coordinates says (snipped to the relevant bits):

The following information is provided for (longitude W89.2, latitude N39.2):

        6 October 2006        Universal Time          

        Sunrise                   11:58    
        Sunset                    23:32      

 It wouldn't accept fractional minutes for the coordinates which probably
accounts for the few seconds difference.

 What numbers are you feeding into the site?

Andy Hassall :: :: :: disk and FTP usage analysis tool

Site Timeline