DateMath is a PHP class which makes date manipulation simple.
$myDate = new DateMath('2011-01-01'); $myDate->addMonths(2)
->addDays(3)
->firstDayOfWeek();
echo $myDate->toString('Y-m-d');
- addSeconds($num)
- addMinutes($num)
- addHours($num)
- addDays($num)
- addMonths($num)
- addYears($num)
- addWeeks($num)
- firstDayOfWeek()
- firstDayOfMonth()
- lastDayOfMonth()
- lastDayOfWeek()
- toString($format = 'Y-m-d H:i:s')
- toGMTString($format = 'Y-m-d H:i:s')
- getTime()