Skip to content

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

Notifications You must be signed in to change notification settings

xahmedtaha/duration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages