Closed baptistebisson closed 5 years ago
Hi,
The problem is that there is no half hours interval like CarbonInterval::hours();
You can use any interval:
CarbonInterval::minutes(30)
Or even: CarbonInterval::hour()->minutes(32)->seconds(30)
Oh great, didn't know we could do that ! Thanks !
Hello,
I'm still having problems to get proper duration with two dates. Here is my example :
Working hours are from
08:30
to12:30
and14:00
to18:00
so 8 hours in total. The problem is that there is no half hours interval likeCarbonInterval::hours();
.In this example I want to get 4 hours 30 minutes but I need to do a lot of condition afterwards to test if this is half hours. Sometimes I remove one hour and add 30 minutes in
$interval
, or just add 30 minutes. For some case it's working but it's far too laborious.I can't use
$resolution = CarbonInterval::minutes();
because it's really slow when I have a duration of 1 week.Is there any simpler solution for that ? Maybe a custom
CarbonInterval
?Thanks !