PHPackages                             alcamo/time - 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. alcamo/time

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

alcamo/time
===========

Date/time-related classes

0.2.6(2w ago)0256↓69%3Apache-2.0PHPPHP 7.3 - 8.5

Since Jan 17Pushed 2w ago1 watchersCompare

[ Source](https://github.com/rv1971/alcamo-time)[ Packagist](https://packagist.org/packages/alcamo/time)[ RSS](/packages/alcamo-time/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (9)Versions (9)Used By (3)

Usage example
=============

[](#usage-example)

```
use alcamo\time\Duration;

$duration = new Duration('P0M1DT02.50S');

echo "$duration\n";

echo $duration->getTotalMinutes() . "\n";

echo $duration->getTotalSeconds() . "\n";

```

This will output:

```
P1DT2.5S
1440
86402.5

```

Unlike PHP's built-in `DateInterval::__construct()`, `Duration::__construct()` can handle fractions of seconds.

Furthermore, methods are provided to get the total number of days, hours, minutes and seconds.

Provided classes
================

[](#provided-classes)

- `Duration` Duration adding features to `DateInterval`
- `PosixFormat` Posix date/time format

See the doxygen documentation for details.

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance97

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community13

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 ~178 days

Recently: every ~30 days

Total

8

Last Release

15d ago

PHP version history (2 changes)0.1PHP 7.3 - 8.0

0.2.6PHP 7.3 - 8.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/db9722b60c5a69929f1d1c7df3d0d8682d74ed19146a2cdd2dfffa7ddc4abc78?d=identicon)[rv1971](/maintainers/rv1971)

---

Top Contributors

[![rv1971](https://avatars.githubusercontent.com/u/39520256?v=4)](https://github.com/rv1971 "rv1971 (8 commits)")

---

Tags

timedateduration

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/alcamo-time/health.svg)

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

###  Alternatives

[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6339.5M56](/packages/knplabs-knp-time-bundle)[brick/date-time

Date and time library

3663.8M108](/packages/brick-date-time)[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[aeon-php/calendar

PHP type safe, immutable calendar library

20810.4M16](/packages/aeon-php-calendar)[tplaner/when

Date/Calendar recursion library.

5331.1M7](/packages/tplaner-when)[florianv/business

DateTime calculations in business hours

362784.1k1](/packages/florianv-business)

PHPackages © 2026

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