PHPackages                             pacely/pronto - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pacely/pronto

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

pacely/pronto
=============

Smart time parser

v1.0.1(11y ago)228MITPHPPHP &gt;=5.4.0

Since Nov 2Pushed 11y ago1 watchersCompare

[ Source](https://github.com/pacely/pronto)[ Packagist](https://packagist.org/packages/pacely/pronto)[ Docs](http://www.hirvi.no)[ RSS](/packages/pacely-pronto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (3)Used By (0)

Simple time converter
=====================

[](#simple-time-converter)

[![Build Status](https://camo.githubusercontent.com/ad1fc645f45e1fee26e4b68e1a68e98ef0d9adff99da485c0045e49d8b6c9cc0/68747470733a2f2f7472617669732d63692e6f72672f706163656c792f70726f6e746f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/pacely/Pronto)[![Latest Stable Version](https://camo.githubusercontent.com/3a37d5720acfaa728595dbb742714c636ec7d2fef792c6d9845babadf3375cbf/68747470733a2f2f706f7365722e707567782e6f72672f6c656170686c792f636172742d62756e646c652f76657273696f6e2e737667)](https://packagist.org/packages/pacely/pronto)[![Latest Unstable Version](https://camo.githubusercontent.com/cb43fa77060261511add7378c02448c5ae57d124af3037bb107148170061ccf0/68747470733a2f2f706f7365722e707567782e6f72672f6c656170686c792f636172742d62756e646c652f762f756e737461626c652e737667)](//packagist.org/packages/pacely/pronto)[![License](https://camo.githubusercontent.com/3864c0d39439273179ec036bb3fce33aeb169cd758eaa224a261c8490cc1c374/68747470733a2f2f706f7365722e707567782e6f72672f6c656170686c792f636172742d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/pacely/pronto)

---

- [Installation](#installation)
- [Registering the Package](#registering-the-package)
- [Formatters](#formatters)
- [Helper methods](#helper-methods)

Installation
------------

[](#installation)

Add pronto to your composer.json file:

```
"require": {
  "pacely/pronto": "dev-master"
}

```

Use composer to install this package.

```
$ composer update

```

### Registering the Package

[](#registering-the-package)

If you are using Laravel Framework, we've made a Service Provider and Facade for you.

Register the service provider within the `providers` array found in `app/config/app.php`:

```
'providers' => array(
	// ...

	'Pacely\Pronto\ProntoServiceProvider'
)
```

Add an alias within the `aliases` array found in `app/config/app.php`:

```
'aliases' => array(
	// ...

	'Pronto' => 'Pacely\Pronto\Facades\Pronto',
)
```

Formatters
----------

[](#formatters)

#### Integer

[](#integer)

Matches integers only. `9` converts to minutes.

InputValue (toTime)909:001000:10```
echo Pronto::parse(10)->toTime(); // 09:00
echo Pronto::parse(9)->toTime(); // 00:10

```

#### Decimal

[](#decimal)

Matches decimal values (float, double). Comma and period characters allowed.

InputValue (toTime)0,500:301,01:001.501:30,500:301. ```
     	| 01:00

    ```

```
echo Pronto::parse('0,5')->toTime(); // 00:30
echo Pronto::parse(1.5)->toTime(); // 01:30

```

#### Range

[](#range)

Matches time range.

InputValue (toTime)09-1001:0009:00 - 10:0001:0009 to 1001:0009-Time between 09:00 and NOW()```
echo Pronto::parse('09-10')->toTime(); // 01:00
echo Pronto::parse('09:00 - 10:00')->toTime(); // 01:00
echo Pronto::parse('09:00-')->toTime(); // Time between 09:00 and NOW

```

#### Short

[](#short)

Matches short-time from *m(minutes)* to *w(week)*. 1 day equals 7.5 hours. 1 week equals 5 days.

InputValue (toTime)1d 2h 30m10:00 (1d = 7.5 hours)2 h 2 m02:021w 2d 20m52:50 (1w = 7.5\*5)```
echo Pronto::parse('1d 2h 30m')->toTime(); // 10:00
echo Pronto::parse('2 h 2 m')->toTime(); // 02:02
echo Pronto::parse('1w 2d 20m')->toTime(); // 52:50

```

Helper methods
--------------

[](#helper-methods)

##### `(int) parse(string)`

[](#int-parsestring)

Returns converted time in seconds

```
$pronto = new Pronto;

echo $pronto->parse('0.5'); // 1800

```

##### `(int) toMinutes()`

[](#int-tominutes)

Converts seconds to minutes

```
echo $pronto->parse('0.5')->toMinutes(); // 30

```

##### `(double) toDecimal()`

[](#double-todecimal)

Converts seconds to decimal hours

```
echo $pronto->parse('2h 30m')->toDecimal(); // 2.5

```

##### `(string) toTime()`

[](#string-totime)

Returns converted time the format `HH:mm`

```
echo $pronto->parse('0.5')->toTime(); // 00:30

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4215d ago

Major Versions

v0.1.1 → v1.0.12014-11-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/a85641995abf250195bbc2a8a2e405f32589507ff0b9873af5bc00e786149d43?d=identicon)[Chris Magnussen](/maintainers/Chris%20Magnussen)

---

Top Contributors

[![ChrisRM](https://avatars.githubusercontent.com/u/309292?v=4)](https://github.com/ChrisRM "ChrisRM (24 commits)")

---

Tags

timeparsesmarttimeparserquick-time

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/pacely-pronto/health.svg)

```
[![Health](https://phpackages.com/badges/pacely-pronto/health.svg)](https://phpackages.com/packages/pacely-pronto)
```

###  Alternatives

[symfony/clock

Decouples applications from the system clock

430168.9M205](/packages/symfony-clock)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6308.9M39](/packages/knplabs-knp-time-bundle)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[wapmorgan/morphos

A morphological solution for Russian and English language written completely in PHP. Provides classes to inflect personal names, geographical names, decline and pluralize nouns, generate cardinal and ordinal numerals, spell out money amounts and time.

8351.3M7](/packages/wapmorgan-morphos)[brick/date-time

Date and time library

3623.3M61](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

2079.7M16](/packages/aeon-php-calendar)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
