-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32af2c4
commit ca656b7
Showing
1 changed file
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Easy Time | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/fredbradley/easytime.svg?style=flat-square)](https://packagist.org/packages/fredbradley/easytime) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
![StyleCI Status](https://github.styleci.io/repos/356180937/shield) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/fredbradley/easytime.svg?style=flat-square)](https://packagist.org/packages/fredbradley/easytime) | ||
|
||
A small class based package to help with human-readable calculations of time. | ||
|
||
For when you need to convert a human-readable number of minutes or seconds into an integer of seconds (for example expiry time on a Cache object) | ||
## Installation | ||
|
||
You can install the package via composer: | ||
|
||
```bash | ||
composer require fredbradley/easytime | ||
``` | ||
|
||
## Usage Examples | ||
|
||
``` php | ||
use FredBradley\EasyTime\EasySeconds; | ||
|
||
$seconds = EasySeconds::AN_HOUR; // returns 3600 | ||
$seconds = EasySeconds::hours(2); // return 7200 | ||
|
||
// What to know how many minutes in a year? | ||
$minutes = EasyMinutes::A_YEAR; | ||
|
||
// And if you want to you can mix them together... | ||
$seconds = EasySeconds::minutes(EasyMinutes::AN_HOUR); // return 3600 | ||
|
||
``` | ||
|
||
Pull requests open for people who find this useful and what to build more. | ||
|
||
### Testing | ||
|
||
``` bash | ||
composer test | ||
``` | ||
|
||
### Changelog | ||
|
||
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | ||
|
||
### Security | ||
|
||
If you discover any security related issues, please email code@fredbradley.co.uk instead of using the issue tracker. | ||
|
||
## Credits | ||
|
||
- [Fred Bradley](https://github.com/fredbradley) | ||
- [All Contributors](../../contributors) | ||
|
||
## License | ||
|
||
The MIT License (MIT). Please see [License File](LICENSE.md) for more information. | ||
|