There is a DateTime object. I want to install it today and save time.
For instance:
- It is installed on 2012-10-12 10:30:00
- he should become 2012-11-22 10:30:00
This will not work, of course:
// this obviously changes it to 2012-11-22 00:00:00 $date->modify('today'));
This will work, but it looks like it will be a little more effort:
$clone = clone $date(); $date->modify('today')->setTime($clone->format('H'), $clone->format('i'));
Is there a shorter / more efficient way?
source share