I'm using PHP to do some modification of DateTime objects. I'm trying to add an amount of time to an existing date. I know that I can do something like this:
$myDate->add(new DateInterval('P1Y'));
to add a year to the time and that works fine. However, in this case I have calculated times that may not always be even (i.e. it could be .723 years or something). As a test I tried passing 'P0.5Y' but it gives me an exception that says 'Unknown or bad format' on the constructor for DateInterval...
What is the best way to do this in PHP?