https://github.com/labrodev/time-converter
PHP 8.1+ utility library that provides static helper methods to convert between seconds, minutes, and hours — built for simplicity and performance.
https://github.com/labrodev/time-converter
composer-library composer-package datetime labrodev php php-converter php-library php-package php-time php-utility php-utils php8 time-converter
Last synced: 7 months ago
JSON representation
PHP 8.1+ utility library that provides static helper methods to convert between seconds, minutes, and hours — built for simplicity and performance.
- Host: GitHub
- URL: https://github.com/labrodev/time-converter
- Owner: labrodev
- License: mit
- Created: 2025-06-29T12:44:48.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T13:02:53.000Z (8 months ago)
- Last Synced: 2025-06-30T01:15:14.213Z (8 months ago)
- Topics: composer-library, composer-package, datetime, labrodev, php, php-converter, php-library, php-package, php-time, php-utility, php-utils, php8, time-converter
- Language: PHP
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.MD
- License: LICENSE
Awesome Lists containing this project
README
# PHP Time Converter
**Labrodev\TimeConverter** is a strict PHP 8.1+ utility library that provides static helper methods to convert between seconds, minutes, and hours — built for simplicity and performance.
## Features
- Convert seconds to minutes
- Convert hours and minutes into raw minute count
- Convert float-based minutes into integer format
- Convert hours (as float) into total minutes
- Fully static and type-safe class
- Lightweight, dependency-free implementation
- Includes PHPUnit and PHPStan support for testing and analysis
## Installation
```
composer require labrodev/time-converter
```
## Usage
```php
use Labrodev\TimeConverter\Converter;
// Convert seconds to minutes
Converter::secondsToMinutes(180); // 3.0
// Convert hours and minutes to raw minutes
Converter::timeToRawMinutes(2, 30); // 150
// Convert float minutes to integer
Converter::floatMinutesToInt(12.7); // 13
// Convert hours to minutes
Converter::hoursToMinutes(1.5); // 90
```
## Testing
To run tests:
```
composer install
composer test
```
## Static Analysis
To run static analysis using PHPStan:
```
composer install
composer analyse
```
> Configuration is located in `phpstan.neon.dist`
## Security
If you discover a security vulnerability within this package, **please contact us immediately at [contact@labrodev.com](mailto:contact@labrodev.com)**. All security-related issues will be handled privately and promptly.
## Credits
This package is maintained by **Labrodev** — Laravel & PHP development studio.
[https://github.com/labrodev](https://github.com/labrodev)
## Feedback
If you have any questions, suggestions, or have found an error — feel free to open an issue or contact us:
**contact@labrodev.com**
**License:** MIT