You have several alternatives besides DateInterval.
Here are examples that use strtotime()
:
http://www.brightcherry.co.uk/scribbles/php-adding-and-subtracting-dates/
// Subtracting days from a date
$date = "1998-08-14";
$newdate = strtotime ( '-3 day' , strtotime ( $date ) ) ;
$newdate = date ( 'Y-m-j' , $newdate );
echo $newdate;
...
// Subtracting months from a date
$date = "1998-08-14";
$newdate = strtotime ( '-3 month' , strtotime ( $date ) ) ;
$newdate = date ( 'Y-m-j' , $newdate );
echo $newdate;
Here's are some links for DateInterval
:
Q: Exactly how do you define a "month"?
Def#1): a "month" is a "month" - regardless of #/days
Def#2): a "month" is 30 days (for example)
Def#3): a "month" is the #/days between the 1st Monday of
subsequent months
etc. etc
Q: What exactly is your "definition"?