summaryrefslogtreecommitdiff
path: root/ext/date
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2007-06-07 23:16:04 +0000
committerIlia Alshanetsky <iliaa@php.net>2007-06-07 23:16:04 +0000
commita6340d27aeff1864b65c608c605838dc73f9741e (patch)
tree3b20c73f0b6c661d4d29503c1abaddd1e9d21c05 /ext/date
parentc4b5196d0b006ee695d4a66b13071aab26ff943b (diff)
downloadphp-git-a6340d27aeff1864b65c608c605838dc73f9741e.tar.gz
Final shot at the date issue
Diffstat (limited to 'ext/date')
-rw-r--r--ext/date/php_date.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index a1159691d1..52986630d8 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -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) {