From d02356922a589443ecd9645df39833d8439f01f3 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 6 Jun 2007 23:16:34 +0000 Subject: [PATCH] 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 36ce6bc123..4a74f2c91c 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2329,9 +2329,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