Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.09 KB

README.md

File metadata and controls

34 lines (22 loc) · 1.09 KB

Duration

Latest Version on Packagist Total Downloads

A php helper function to express time durations and convert them easily.

Installation

You can install the package via composer:

composer require xahmedtaha/duration

Usage

echo duration(hours: 2, minutes: 24)->inMilliseconds(); // 8640000
echo duration(days: 12, minutes: 24, seconds: 13, milliseconds: 15)->inSeconds(); // 18733.015
echo duration(days: 3, hours: 16)->inMinutes(); // 19680
echo duration(days: 3, hours: 2, minutes: 24)->inHours(); // 74.4
echo duration(days: 12, hours: 3, minutes: 24, seconds: 13, milliseconds: 15)->inDays(); // 12.141817

Credits

License

The MIT License (MIT). Please see License File for more information.