You are here: Re: sunrise/sunset « PHP Programming Language « IT news, forums, messages
Re: sunrise/sunset

Posted by Andy Hassall on 10/06/06 22:25

On Fri, 06 Oct 2006 21:50:26 GMT, Your Name <email@address.com> wrote:

>I'm trying to use date_sunrise() and date_sunset() functions in my php5
>code.
>
>I use them as follows:
>
>date_default_timezone_set("America/New_York");
>$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
>http://aa.usno.navy.mil/data/docs/RS_OneDay.html).
>
>What am I doing wrong?

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):

Friday
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 :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация