|
1 | | -# Very short description of the package |
| 1 | +# Seconds |
2 | 2 |
|
3 | | -[](https://packagist.org/packages/035media/seconds) |
4 | | -[](https://travis-ci.org/035media/seconds) |
5 | | -[](https://scrutinizer-ci.com/g/035media/seconds) |
6 | | -[](https://packagist.org/packages/035media/seconds) |
| 3 | +[](https://packagist.org/packages/adevade/seconds) |
| 4 | +[](https://packagist.org/packages/adevade/seconds) |
7 | 5 |
|
8 | | -This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention of what PSRs you support to avoid any confusion with users and contributors. |
| 6 | +Helpers for converting time to seconds. |
9 | 7 |
|
10 | 8 | ## Installation |
11 | 9 |
|
12 | 10 | You can install the package via composer: |
13 | 11 |
|
14 | 12 | ```bash |
15 | | -composer require 035media/seconds |
| 13 | +composer require adevade/seconds |
16 | 14 | ``` |
17 | 15 |
|
18 | 16 | ## Usage |
19 | 17 |
|
20 | | -``` php |
21 | | -// Usage description here |
22 | | -``` |
23 | | - |
24 | | -### Testing |
| 18 | +```php |
| 19 | +use Adevade\Seconds\Seconds; |
25 | 20 |
|
26 | | -``` bash |
27 | | -composer test |
| 21 | +Seconds::fromMinutes(2); // returns => (int) 120 |
28 | 22 | ``` |
29 | 23 |
|
30 | | -### Changelog |
31 | | - |
32 | | -Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently. |
33 | | - |
34 | | -## Contributing |
| 24 | +### Available methods |
| 25 | + |
| 26 | +```php |
| 27 | +Seconds::fromMinutes($int); |
| 28 | +Seconds::fromHours($int); |
| 29 | +Seconds::fromDays($int); |
| 30 | +Seconds::fromWeeks($int); |
| 31 | +Seconds::fromMonths($int); |
| 32 | +Seconds::fromYears($int); |
| 33 | + |
| 34 | +Seconds::fromMinute(); |
| 35 | +Seconds::fromHour(); |
| 36 | +Seconds::fromDay(); |
| 37 | +Seconds::fromWeek(); |
| 38 | +Seconds::fromMonth(); |
| 39 | +Seconds::fromYear(); |
| 40 | +``` |
35 | 41 |
|
36 | | -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. |
| 42 | +### Available constants |
37 | 43 |
|
38 | | -### Security |
| 44 | +```php |
| 45 | +Seconds::MINUTE; |
| 46 | +Seconds::HOUR; |
| 47 | +Seconds::DAY; |
| 48 | +Seconds::WEEK; |
| 49 | +Seconds::MONTH; |
| 50 | +Seconds::YEAR; |
| 51 | +``` |
39 | 52 |
|
40 | | -If you discover any security related issues, please email andreas@035media.se instead of using the issue tracker. |
| 53 | +> Months have an average length of 30.42 days.\ |
| 54 | +> Years have an average length of 365.24 days. |
41 | 55 |
|
42 | 56 | ## Credits |
43 | 57 |
|
44 | | -- [Andréas Lundgren](https://github.com/035media) |
45 | | -- [All Contributors](../../contributors) |
46 | | - |
47 | | -## License |
48 | | - |
49 | | -The MIT License (MIT). Please see [License File](LICENSE.md) for more information. |
50 | | - |
51 | | -## PHP Package Boilerplate |
| 58 | +- [Andréas Lundgren](https://github.com/adevade) |
52 | 59 |
|
53 | | -This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com). |
| 60 | +Idea came from [this tweet by @LasseRafn](https://twitter.com/LasseRafn/status/1225017098373685255). Thanks! |
0 commit comments