Quote:
Originally Posted by louie Does any of you came across a PHP function to be able to remove 3 months from a specific date.
I need to find records in the DB based on start date YEAR-MONTH-01 minus 3months and end date YEAR-MONTH-31, 30 or 28 minus 3 month depending on the dates given. |
Not sure about PHP but I think that the DATE_SUB() function in MySQL will allow you to subtract months. Something like this:
SELECT DATE_SUB('2008-08-01', INTERVAL 3 MONTH);
I haven't used this function recently. It may also be dependent on the version of MySQL. Works in 4.n and 5.n.
Regards...jmcc