Final shot at the date issue

This commit is contained in:
Ilia Alshanetsky 2007-06-07 23:16:04 +00:00
parent c4b5196d0b
commit a6340d27ae

View File

@ -2330,10 +2330,8 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
}
N = (calc_sunset ? h_set : h_rise) + gmt_offset;
if (N > 24) {
if (N > 24 || N < 0) {
N -= floor(N / 24) * 24;
} else if (N < 0) {
N = floor(N / 24) * 24 + 24;
}
switch (retformat) {