php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37743 results not as expected for date_sunrise
Submitted: 2006-06-08 13:07 UTC Modified: 2006-06-08 19:11 UTC
Votes:6
Avg. Score:4.7 ± 0.7
Reproduced:6 of 6 (100.0%)
Same Version:3 (50.0%)
Same OS:-1 (-16.7%)
From: webdev at etzchaimkgh dot org Assigned:
Status: Wont fix Package: Date/time related
PHP Version: 5.1.4 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: webdev at etzchaimkgh dot org
New email:
PHP Version: OS:

 

 [2006-06-08 13:07 UTC] webdev at etzchaimkgh dot org
Description:
------------
Results of the date_sunrise function do not match times as reported by U.S. Naval Observatory 
(http://aa.usno.navy.mil/data/docs/RS_OneDay.html) and others

Reproduce code:
---------------
$ts = mktime(0,0,0,  6 , 7 ,2006); 
echo date_sunrise($ts, SUNFUNCS_RET_STRING, 40.8, -73.8, 90 + (50/60) , -4); 




Expected result:
----------------
5:24

Actual result:
--------------
5:22

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-08 13:51 UTC] derick@php.net
There are slight difference in algorithms for calculating those things. It's extremely hard as you have to factor in *many* different parameters (including state of the atmosphere). A two minute difference is therefore expected and not really a bug.
 [2006-06-08 19:11 UTC] webdev at etzchaimkgh dot org
I am sorry to hear that you would take such an odd position - an algorithm that comes up with different results than the U.S. government. The government does not take into account factors such as altitude an atmosphere when calculating. The computations and results should match. 2 minutes is HUGE difference - 2 seconds would be more like something one might be willing to ignore. You should at least document your "expected" difference in the manual. Thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 09:01:29 2024 UTC