in a laravel
app I have a range of times(start
and end
), if the end time is after 00:00:00
, then it would be set to the next Day
edit
for exemple :
start = 22:00:00
and end = 04:00:00
so here end hour is after 00:00:00
so it should be set to the next day
2
Answers
Use
$carbon->gt()
.Usually if start time and end time is on the same day,
$startTime
should be less then$endTime
, right?If not so, then
$endTime
they must to be happening different daysSo you can just write: