Created
August 8, 2023 04:52
-
-
Save tuto1902/202554b16a03009eb2324b603112d8f6 to your computer and use it in GitHub Desktop.
Revisions
-
tuto1902 created this gist
Aug 8, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ Create an interval collection of times between 8:00 am and 5:00 pm in 30 minute intervals ```PHP $timeStep = 30 $start = '08:00:00' $end = '17:00:00' $intervals = CarbonInterval::minutes($timeStep)->toPeriod($start, $end); ``` Use the interval collection ```PHP foreach ($intervals as $date) { dump($date->format('H:i')) } ```