]> granicus.if.org Git - php/commitdiff
Fix bug #49558
authorRasmus Lerdorf <rasmus@php.net>
Tue, 15 Sep 2009 20:28:42 +0000 (20:28 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Tue, 15 Sep 2009 20:28:42 +0000 (20:28 +0000)
And as Colin mentioned in the bug report, this means date_sunrise()
and date_sunset() have been off by 26 seconds in most cases until now.

ext/date/php_date.c

index fafe4f97d5f084df4f5269c377575b12a339fd50..c4598fae08b43bc04d4624b10939af7cbe828ae7 100644 (file)
@@ -3927,7 +3927,7 @@ static void php_do_date_sunrise_sunset(INTERNAL_FUNCTION_PARAMETERS, int calc_su
        }
 
        timelib_unixtime2local(t, time);
-       rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0, &h_rise, &h_set, &rise, &set, &transit);
+       rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, calc_sunset?0:1, &h_rise, &h_set, &rise, &set, &transit);
        timelib_time_dtor(t);
        
        if (rs != 0) {