#33789 [Asn->Csd]: Many Problems with SunFuncs
| From: | derick@php.net | Date: | Wed, 04 Jan 2006 21:41:21 +0000 |
| Subject: | #33789 [Asn->Csd]: Many Problems with SunFuncs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-91501@lists.php.net to get a copy of this message | ||
ID: 33789
Updated by: derick@php.net
Reported By: jsgoupil@php.net
-Status: Assigned
+Status: Closed
Bug Type: Date/time related
Operating System: *
PHP Version: 5CVS-2005-12-19 (cvs)
Assigned To: derick
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Fixed for 5.1.2 and later
Previous Comments:
------------------------------------------------------------------------
[2005-07-20 19:46:39] jsgoupil@php.net
uh oh...
Check the return of
SUNFUNCS_RET_TIMESTAMP
You have corrected it little time ago BUT now it seems that GMT is
substracted twice. I receive the sunset at 16:24 and supposed to be at
20:24 (I receive 20:24 if I put the SUNFUNCS_RET_STRING with ret+=24).
echo date("H:i", date_sunset(time(), 0, 46.49, -71.14, 90.0));
------------------------------------------------------------------------
[2005-07-20 16:58:52] jsgoupil@php.net
assert happens for
php_sunrise_sunset( 201, -71.14, 90, 90, 1)
(UTx != UT)
------------------------------------------------------------------------
[2005-07-20 16:55:44] jsgoupil@php.net
Description:
------------
With sunfuncs (date_sunrise, date_sunset)
When I do date_sunset(time(), 46.49, -71.14, 90); (I forgot the output
format). The server seems to be frozen and I can't load another page
before I restart Apache...
Even with this line (with the output format) : echo date_sunset(time(),
1, -71.14, 90, 90);
Next:
When asking for a String format, if the var "ret" is near 00:00 and
adding a gmt negative (see sunfuncs.c), the output will be bad (-3:-3)
(because of the gmt_offset).
because the line
sprintf(retstr, "%02d:%02d", N, (int) (60 * (ret - (double) N)));
doesn't care about negative or positive values
You should add
if(ret < 0){
ret += 24;
}
(almost the same as #31853 but negative values appears on string and
double)
In doc, it should explain a little more the decimal values for
latitude, is it minutes (60 based) or 100 based.
Moreover, I spent time to realize that zenith was the angle for the sun
when it is on the horizon (so almost always 90), it should be written in
the doc.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33789&edit=1