Page 1 of 1

date minus 3 months

Posted: Wed Jan 14, 2009 10:59 am
by mad_phpq
Hi,

I'd like to be able to minus 3 months from a date and then round it down to 1st of that month.

Example:

(format british time d/m/y)
today = "14/1/2009";

three months ago = "1/10/2008"

Can anyone tell me how I can do this using php?

Thanks

--Mark

Re: date minus 3 months

Posted: Wed Jan 14, 2009 11:53 am
by jaoudestudios
Check out example 3 on...
http://uk3.php.net/date

Re: date minus 3 months

Posted: Wed Jan 14, 2009 3:37 pm
by pickle
strtotime() I think is better suited for adding or removing time.

Re: date minus 3 months

Posted: Mon Jan 19, 2009 3:25 pm
by mad_phpq
thanks jaoudestudios , that did it.