ID: 32820
Updated by: [EMAIL PROTECTED]
Reported By: matt-dated-1114405650 dot e8a5a2 at codewalkers
-Status: Open
+Status: Assigned
Bug Type: Date/time related
Operating System: *
PHP Version: 5CVS-2005-04-25 (dev)
-Assigned To:
+Assigned To: derick
Previous Comments:
------------------------------------------------------------------------
[2005-04-25 06:35:14] matt-dated-1114405650 dot e8a5a2 at codewalkers
Sorry...
"There seems to be a bug in date_sunrise and date_sunset when the GMT
offset is greater than the sunrise or sunset time."
should have read:
"There seems to be a bug in date_sunrise and date_sunset when the GMT
offset is negative and the absolute value is greater than the sunrise
or sunset time."
------------------------------------------------------------------------
[2005-04-25 06:24:03] matt-dated-1114405650 dot e8a5a2 at codewalkers
Description:
------------
There seems to be a bug in date_sunrise and date_sunset when the GMT
offset is greater than the sunrise or sunset time.
For instance, if the date_sunset function returns '00:14' as the sunset
time in GMT, trying to use the GMT offset of -4 would result in '-3:-4'
being returned.
In sunfuncs.c there is a line:
ret = php_sunrise_sunset(N, latitude, longitude, zenith, calc_sunset) +
gmt_offset;
It seems that it should check if gmt_offset is greater than the
returned value from php_sunrise_sunset and if so, add 24 to the
returned value before the addition of gmt_offset.
Reproduce code:
---------------
<?php
echo date("D M d Y"). ', sunset time : ' .date_sunset(time(),
SUNFUNCS_RET_STRING, 40, -83, 90, -4);
?>
Expected result:
----------------
I would expect to see:
Sun Apr 24 2005, sunset time : 20:14
Actual result:
--------------
I actually see:
Sun Apr 24 2005, sunset time : -3:-4
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32820&edit=1