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?
Add 1 day to Datetime?
Moderator: General Moderators
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: Add 1 day to Datetime?
Try
Code: Select all
date("Y-m-d H:i",strtotime($date." +1 day"))Re: Add 1 day to Datetime?
Thanks! Worked great!
Thanks again!
Thanks again!