php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49448 Sunset/Sunrise Zenith default values wrong
Submitted: 2009-09-03 07:58 UTC Modified: 2010-03-07 16:30 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: the_good_technician at yahoo dot com Assigned: derick (profile)
Status: Not a bug Package: Date/time related
PHP Version: 5.3.0 OS: *
Private report: No CVE-ID: None
 [2009-09-03 07:58 UTC] the_good_technician at yahoo dot com
Description:
------------
This is an easy problem to fix.  I'm surprised nobody has reported it so far.

The default configuration value for "date.sunrise_zenith" and "date.sunset_zenith" is "90.583333".  But this value is incorrect!  

The correct value for a sunrise/sunset zenith angle is 90 + (50/60)
WHICH EQUALS
90.83333333333
NOT
90.58333333333



Reproduce code:
---------------
echo ini_get("date.sunrise_zenith") . "\n";
echo ini_get("date.sunset_zenith") . "\n";


Expected result:
----------------
90.83333333333
90.83333333333


Actual result:
--------------
90.58333333333
90.58333333333


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-03-07 16:30 UTC] derick@php.net
-Status: Assigned +Status: Bogus
 [2010-03-07 16:30 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

The algorithm code we use, clearly says:

 *       altit = the altitude which the Sun should cross              
 *               Set to -35/60 degrees for rise/set, -6 degrees       
 *               for civil, -12 degrees for nautical and -18          
 *               degrees for astronomical twilight.                   

and -35/60 = −0.583333333.
 [2011-10-02 20:02 UTC] dronkert at gmail dot com
Derick is right that the value is correct according to the "algorithm" (actually 
just a statement) but the submitter is correct that the canonical value is 90º50' 
or 90.8333333 degrees. Thus the problem is the source and perhaps validity of the 
code documentation. Where does the 90º35' value come from? I could only find 
references to 90º50'.
 [2011-12-01 14:00 UTC] marcus dot fritze at googlemail dot com
I also don't understand where the 35/60 is coming from. Do you have any reliable sources?

Description:

"Sunrise and sunset. For computational purposes, sunrise or sunset is defined to occur when the geometric zenith distance of center of the Sun is 90.8333 degrees. That is, the center of the Sun is geometrically 50 arcminutes below a horizontal plane. For an observer at sea level with a level, unobstructed horizon, under average atmospheric conditions, the upper limb of the Sun will then appear to be tangent to the horizon. The 50-arcminute geometric depression of the Sun's center used for the computations is obtained by adding the average apparent radius of the Sun (16 arcminutes) to the average amount of atmospheric refraction at the horizon (34 arcminutes)."

Source:

http://www.usno.navy.mil/USNO/astronomical-applications/astronomical-information-center/rise-set-twi-defs
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Apr 14 01:01:25 2021 UTC