php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #62548 3rd Parameter in Date_Sunrise() and Date_Sunset() is incorrectly named.
Submitted: 2012-07-13 12:20 UTC Modified: 2018-02-12 22:22 UTC
From: vascowhite at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Date/time related
PHP Version: 5.4.4 OS: N/A
Private report: No CVE-ID: None
 [2012-07-13 12:20 UTC] vascowhite at gmail dot com
Description:
------------
See the documentation at http://us2.php.net/function.date-sunrise and at 
http://us2.php.net/manual/en/function.date-sunset.php

zenith:-
This is the point on the celestial sphere directly above the observer's head and 
will have no bearing on the calculation whatsoever. 'zenith = 90' makes no sense 
at all.

The term you are looking for is 'azimuth', which is used in sunrise, sunset 
calculations to tell if the bearing of the sun from the observer is East or West 
of North.

Hence, the 3rd parameter in these functions should be 'azimuth' and not 
'zenith'.

References:-

http://en.wikipedia.org/wiki/Zenith
http://en.wikipedia.org/wiki/Azimuth


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-07-20 02:29 UTC] aharvey@php.net
That is what the parameters are actually called in the source, so I'll punt this back to the ext/date bug queue rather than documentation for now.
 [2012-07-20 02:29 UTC] aharvey@php.net
-Type: Documentation Problem +Type: Bug -Package: Documentation problem +Package: Date/time related
 [2018-02-08 16:51 UTC] cmb@php.net
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem
 [2018-02-08 16:51 UTC] cmb@php.net
> zenith:-
> This is the point on the celestial sphere directly above the
> observer's head and will have no bearing on the calculation
> whatsoever.

That's not correct here.  zenith actually means the zenith angle,
which is important to calculate twilight times.  See also
<https://web.archive.org/web/20161202180207/http://williams.best.vwh.net/sunrise_sunset_algorithm.htm>.

Obviously, the documentation should clarify this.
 [2018-02-12 22:22 UTC] cmb@php.net
-Status: Verified +Status: Closed -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 26 13:01:32 2024 UTC