diff --git a/phpgwapi/inc/class.datetime.inc.php b/phpgwapi/inc/class.datetime.inc.php index e46ef14c53..502c973411 100755 --- a/phpgwapi/inc/class.datetime.inc.php +++ b/phpgwapi/inc/class.datetime.inc.php @@ -425,40 +425,12 @@ /*! @function days_between @abstract Get the number of days between two dates - @author Steven Cramer + @author Steven Cramer/Ralf Becker @param $m1 - Month_1, $d1 - Day_1, $y1 - Year_1, $m2 - Month_2, $d2 - Day_2, $y2 - Year_2 */ function days_between($m1,$d1,$y1,$m2,$d2,$y2) { -// $start = "$d1.$m1.$y1"; - - if ($y1 == $y2 && $m1 == $m2) - { - $days = $d2 - $d1; - } - else - { - $days = $this->days_in_month($m1,$y1) - $d1; - while ($m1 != $m2 || $y1 != $y2) - { - if ($m1+1 == 13) - { - $m1 = 1; - $y1++; - } - else - { - $m1++; - } - - if ($m1 != $m2 || $y1 != $y2) - { - $days += $this->days_in_month($m1,$y1); - } - } - $days += $d2; - } - return $days; + return intval((mktime(0,0,0,$m2,$d2,$y2) - mktime(0,0,0,$m1,$d1,$y1)) / 86400); } function date_compare($a_year,$a_month,$a_day,$b_year,$b_month,$b_day)