PHP Classes

subtract Month

Recommend this page to a friend!

      Date and Time Calculator  >  All threads  >  subtract Month  >  (Un) Subscribe thread alerts  
Subject:subtract Month
Summary:calculate wrong month when you subtract more than 12 months
Author:Marc Ostroznik
Date:2008-06-25 07:26:25
Update:2008-06-25 17:10:08

  1. subtract Month   Reply   Report abuse  
Picture of Marc Ostroznik Marc Ostroznik - 2008-06-25 07:26:26
hi elac,
in the month substract are a mistake:
you have in line 424

$numofmonths = $monpos % 12;
the variable $monpos are not set in you class
correct are this
$numofmonths = $this->month % 12;

very nice class.

Best regards,


  2. Re: subtract Month   Reply   Report abuse  
Picture of Cale O Cale O - 2008-06-25 17:10:08 - In reply to message 1 from Marc Ostroznik
Thanks for noticing that and telling me. It's fixed now. I had to change that whole month subtraction section so you might want to download the newest version (0.9.3).