raupp/business-hours-diff

A PHP library to calculate business hours between two dates.

Maintainers

Package info

github.com/RauppRafael/BusinessHoursDiff

pkg:composer/raupp/business-hours-diff

Statistics

Installs: 645

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.3 2018-05-23 22:24 UTC

This package is not auto-updated.

Last update: 2026-03-15 12:25:44 UTC


README

A PHP library to calculate business hours between two dates

Installation

composer require raupp/business-hours-diff

Usage

$businessOpensAt = 9;
$businessClosesAt = 19;

$date1 = Carbon::parse('2018-04-01 08:02');
$date2 = Carbon::parse('2018-04-01 22:39');

$minutes = (new BusinessHoursDiff())
                ->businessOpensAt(9)
                ->businessClosesAt(19)
                ->diff($date1, $date2);
            
echo $minutes;      // 600