A lightweight PHP package for working with time durations in a consistent way, with support for parsing, converting, and formatting duration values.
This package is designed to keep duration handling simple and reusable across Laravel and standalone PHP projects. It helps you avoid repeating custom parsing logic for things like minutes, seconds, human-readable strings, or time stamps coming from forms, APIs, or internal tools.
What it’s for
PHP Duration is useful when you need to handle values such as:
13 minutes 17 seconds7:31PT1H30M- raw seconds
Instead of converting duration ad-hoc throughout your application, you can centralise that logic into a small, reusable package.
Highlights
- Simple duration handling for common time formats.
- Framework-agnostic core that can be used outside Laravel.
- Laravel-friendly when you want to plug durations into app logic cleanly.
- Useful for forms, APIs, timers, scheduling, and reporting.
- Keeps parsing and formatting logic in one place.
Why I built it
Duration handling is one of those small problems that shows up everywhere and gets messy quickly. I built this package to make it easier to work with time spans in a way that’s clean, reusable, and not tied to a single framework.
Tech focus
- PHP 8+
- Duration parsing
- Formatting and normalisation
- Laravel compatibility
- Standalone design