From 2d13cd37be8e2824eb53c1cddc047760b7e00e48 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 6 Jun 2007 23:16:45 +0000 Subject: [PATCH] MFB: Adjust previous patch to work on all compilers --- ext/date/php_date.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index ea70ec3562..6654618bd9 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2486,9 +2486,9 @@ 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) { - N %= 24; + N -= floor(N / 24) * N; } else if (N < 0) { - N = N % 24 + 24; + N = floor(N / 24) * -N + 24; } switch (retformat) { -- 2.50.1