Page 1 of 1

Add 1 day to Datetime?

Posted: Wed Aug 04, 2010 1:53 am
by zachbb
I have a DateTime variable, which I display in this format:
"Y-m-d H:i"

I would like to add 1 day to the variable. I can't just do +1 as there are a limited number of days in a month (e.g. never 32)! It would have to go to the next month when neccessary.

Any ideas?

Re: Add 1 day to Datetime?

Posted: Wed Aug 04, 2010 2:01 am
by internet-solution
Try

Code: Select all

date("Y-m-d H:i",strtotime($date." +1 day"))

Re: Add 1 day to Datetime?

Posted: Thu Aug 05, 2010 1:54 am
by zachbb
Thanks! Worked great!

Thanks again!