X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdate_functions.inc;h=6f8379e072877bbf9413f274ca29366da2af68a6;hb=aeef2bf17512535dcdc1b37dc41bee9d7e517da5;hp=94525a3307fcc3195c3d1e37d72a6c285636f758;hpb=f0f7c6e724d0b8dfb010c8ee135981376d72d4c5;p=fa-stable.git diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 94525a33..6f8379e0 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -266,11 +266,10 @@ function add_months($date, $months) // accepts negative values as well { global $date_system; list($day, $month, $year) = explode_date_to_dmy($date); + $months += $year*12+$month; $month = ($months-1)%12+1; $year = ($months-$month)/12; - if ($month < 0) - $month += 12; $timet = mktime(0,0,0, $month, min($day, days_in_month($month, $year)), $year);