ID: 49558 Updated by: ras...@php.net Reported By: eclipsechasers2 at yahoo dot com -Status: Open +Status: Closed Bug Type: Date/time related Operating System: * PHP Version: 5.2.10 New Comment:
Fixed in SVN Previous Comments: ------------------------------------------------------------------------ [2009-09-15 20:34:55] s...@php.net Automatic comment from SVN on behalf of rasmus Revision: http://svn.php.net/viewvc/?view=revision&revision=288356 Log: Fix for bug #49558 for 5.2 and HEAD as well. ------------------------------------------------------------------------ [2009-09-15 20:28:42] s...@php.net Automatic comment from SVN on behalf of rasmus Revision: http://svn.php.net/viewvc/?view=revision&revision=288354 Log: Fix bug #49558 And as Colin mentioned in the bug report, this means date_sunrise() and date_sunset() have been off by 26 seconds in most cases until now. ------------------------------------------------------------------------ [2009-09-15 19:27:03] colin at viebrock dot ca The comments from the sun.c file are also in PHP's ext/date/lib/astro.c (around line 187). >From my reading of things, this upper-limb value should be pegged at 1 in php_date.c Which, of course, means that most systems have been generating sunrise/set times that are off by about 26 seconds. Think of all the angry emails you're gonna get from The Weather Network! ------------------------------------------------------------------------ [2009-09-15 18:11:10] kr dot shaishav at gmail dot com This is from the original sun.c file Written as DAYLEN.C, 1989-08-16 Modified to SUNRISET.C, 1992-12-01 (c) Paul Schlyter, 1989, 1992 Released to the public domain by Paul Schlyter, December 1992 Portions Modified to SUNDOWN.NLM by Cliff Haas 98-05-22 the comment states /* upper_limb: non-zero -> upper limb, zero -> center */ /* Set to non-zero (e.g. 1) when computing rise/set */ /* times, and to zero when computing start/end of */ /* twilight. */ Therefore, if we are calculating sunrise-sunset time the value of upper_limb will be set to permanently non zero. If twilight time is needed then it has to be 0. (PS - just for clearing what this upper limb is. Sunrise happens when the sun's centre is visible. But for the twilight to occur, the sun's top should come over the horizon. that means,centre angle - sradius:) ------------------------------------------------------------------------ [2009-09-15 17:43:04] ras...@php.net Hardcoding that upper_limit to correction flag to either 0 or 1 does remove the quirk in the series. So, is it correct that for the sunrise function we should just peg it at 1? ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/49558 -- Edit this bug report at http://bugs.php.net/?id=49558&edit=1