|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-04-25 06:35 UTC] matt-dated-1114405650 dot e8a5a2 at codewalkers
[2005-10-09 00:04 UTC] filcab at gmail dot com
[2006-01-04 22:40 UTC] derick@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 09 04:00:01 2025 UTC |
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