I have an object DateTime, and I need to move it to the next day of the Xmonth. For example, if Xequal to 15:
2011-02-03 → 2011-02-15 # Before 15, stay this month
2011-02-15 → 2011-02-15 # Today is 15, stay today
2011-02-20 → 2011-03-15 # Later than 15, go to the next month
I know that I can use the combination DateTime::format()and DateTime::setDate(), but is it possible to make it with one click on DateTime::modify()?
!It should also work under . PHP/5.2.14
Expressions containing "day 15" are not even parsed.
source
share