summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/date/php_date.c4
1 files 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) {