473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

sunrise/sunset

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?
Mark
Oct 6 '06 #1
1 2037
On Fri, 06 Oct 2006 21:50:26 GMT, Your Name <em***@address.comwrote:
>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 :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

56
by: john bailo | last post by:
I just installed mono from ximian on my redHat 9 workstation and wrote a simple program from the interesting book ado.net in c# by Mahesh Chand. mono is fun ( is there ado for linux ? ...
4
by: Eurydice | last post by:
For a given town I search a javascript that gives the hour of the sunset and the sunrise. Looks simple but not found up to now on the net Thanks email : Dalip at ifrance.com...
6
by: Paul M | last post by:
hi there, i have an xml file, but am not too sure how to read all these elements using vb.net code. any help would be greatly appreciated:)) <---------CODE---------------> <?xml...
4
by: Paul M | last post by:
Larry, i've got an xml file which has multiple cities as the top level item. When i read it in using XMLReader, and define the variables, as below, it finds the correct number of cities in the...
2
by: Georges Heinesch | last post by:
Hi. I need some VBA code to calculate sunrise and sunset for certain locations. Is there any know code for this (or library) or is there any site which is holding such formulas? The code...
8
by: Penguin | last post by:
We are wondering if there is a way to write a function, or perhaps a class, that can do the following. When you start to type a built-in Access function, when you start to type the function, you...
1
by: Rob Szumlakowski | last post by:
Hi. I'm trying to determine what the expected Sunset Date for the official termination of support for the .NET 1.1 platform? When can we expect Microsoft to stop supporting .NET 1.1 and expect...
1
by: Herbert Sauerer | last post by:
Hello, can anybody tell me, what's wrong with tis code? date_sunset() and date_sun_info() return totally different values for the same time and location. <?php $lat = 50; $lon = 11;
0
by: tradeinputian.005 | last post by:
Dear my friend It is our pleasure to meet you here. we are Sunrise East Asia Sporting Goods Co.,Ltd in Fujian of China. our website: http://www.trade-in-putian.cn
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.