From 4d4f86af2bc8948ce34daab94de04233c61abd71 Mon Sep 17 00:00:00 2001 From: Ralf Becker <ralfbecker@outdoor-training.de> Date: Tue, 18 Mar 2003 18:02:36 +0000 Subject: [PATCH] an other issue with daylight-saveing in days_between solved, now the calculation is down ignoring the daylight-saveing --- phpgwapi/inc/class.datetime.inc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.datetime.inc.php b/phpgwapi/inc/class.datetime.inc.php index 502c973411..f7744e0907 100755 --- a/phpgwapi/inc/class.datetime.inc.php +++ b/phpgwapi/inc/class.datetime.inc.php @@ -427,10 +427,11 @@ @abstract Get the number of days between two dates @author Steven Cramer/Ralf Becker @param $m1 - Month_1, $d1 - Day_1, $y1 - Year_1, $m2 - Month_2, $d2 - Day_2, $y2 - Year_2 + @note the last param == 0, ensures that the calculation is always done without daylight-saveing */ function days_between($m1,$d1,$y1,$m2,$d2,$y2) { - return intval((mktime(0,0,0,$m2,$d2,$y2) - mktime(0,0,0,$m1,$d1,$y1)) / 86400); + return intval((mktime(0,0,0,$m2,$d2,$y2,0) - mktime(0,0,0,$m1,$d1,$y1,0)) / 86400); } function date_compare($a_year,$a_month,$a_day,$b_year,$b_month,$b_day)