]> granicus.if.org Git - php/commitdiff
MFB: Final shot at the date issue
authorIlia Alshanetsky <iliaa@php.net>
Thu, 7 Jun 2007 23:16:41 +0000 (23:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 7 Jun 2007 23:16:41 +0000 (23:16 +0000)
ext/date/php_date.c

index 9a95fc3aa3e1f3f142aa1e97eb82ae20cb2a4801..5c0c63be43863ea2f98bc4d4c4c2853894744256 100644 (file)
@@ -2487,10 +2487,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) {