I managed to dynamically load and compare several time values in PHP.
Right now I am stuck here:
$additional_time = $entry_start->diff($compare_from_timeformat);
$additional_time ->format("H:i");
$avaliabletime->modify('+1 hours');
I want to replace the +1
with $avaliabletime
but if i try something like this:
$avaliabletime->modify('+'.$additional_time.' hours');
I get this error:
Catchable fatal error: Object of class DateInterval could not be converted to string
So I got 2 questions now.
- is there a way to use a variable with the modify part ?
- can I also add minutes in the same string ? for example
$avaliabletime->modify('+01:45 hours');
?