xenon / datetime-calc
This is a date time calculation library for php based on Carbon
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/xenon/datetime-calc
Requires
- php: ^8.0
- ext-curl: *
- ext-json: *
- nesbot/carbon: >=2.68.1
This package is auto-updated.
Last update: 2025-10-29 03:12:22 UTC
README
Breakdown and Splitting Time Range
$time = new TimeBreakDown(
startTime: '11:00',
endTime: '12:00'
);
$time->setIntervalMinute(30);
$time->setBreakDuration(2);
$time->includeBreaks(1);
$data = $time->getIntervals(
breakString: 'is_break',
startTimeFormat: 'H:i:s',
endTimeFormat: 'H:i:s'
);
This will print below time split with 30mins breaks in every stage and it has 2mins break als
Array
(
[0] => Array
(
[start] => 11:00:00
[end] => 11:30:00
)
[1] => Array
(
[start] => 11:30:00
[end] => 11:32:00
[is_break] => 1
)
[2] => Array
(
[start] => 11:32:00
[end] => 12:02:00
)
[3] => Array
(
[start] => 12:02:00
[end] => 12:04:00
[is_break] => 1
)
)