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

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

ddd/time
========

139PHP

Since Sep 8Pushed 12y ago3 watchersCompare

[ Source](https://github.com/ddd-php/Time)[ Packagist](https://packagist.org/packages/ddd/time)[ RSS](/packages/ddd-time/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

TimeMachine
===========

[](#timemachine)

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

[](#installation)

Using Composer, just require the `ddd/time` package:

```
{
    "require": {
        "ddd/time": "dev-master"
    }
}
```

Howtos
------

[](#howtos)

```
Ddd\Time\Tests\HowTo\DateInterval
 [x] How to get number of days between 2 dates
 [ ] How to get number of hours between 2 dates
 [ ] How to get number of minutes between 2 dates
 [ ] How to get number of seconds between 2 dates
 [x] How to get each day between 2 dates
 [x] How to know if a date interval is before after during other date interval
 [ ] How to know if a date interval is before after during a given date
 [x] How to know if a date interval is before after during a given time interval
 [ ] How to know if a date interval is before after during a given time point
 [ ] How to tranform date interval into time interval

Ddd\Time\Tests\HowTo\Date
 [x] How to create a date only
 [x] How to come back at begin of current week
 [x] How to know if a date is after before equal to an other
 [x] How to convert a ddd time date object into regular date time object
 [x] How to know if date is during weekend or weekday
 [x] How to get previous next date
 [x] How to add remove a duration from it in days
 [ ] How to add remove a duration from it in years months weeks
 [ ] How to add remove a duration from it in hours minutes seconds
 [x] How to add remove a composite duration
 [x] How to transform a date into a time point
 [x] How to know diff between it and an other date
 [ ] How to know diff between it and a time point
 [x] How to know if date is before during after a date interval

Ddd\Time\Tests\HowTo\Duration
 [x] How to know how long x days in hours minutes seconds
 [ ] How to know how long x weeks in days hours minutes seconds
 [ ] How to know how long x months in weeks days hours minutes seconds
 [ ] How to know how long x years in months weeks days hours minutes seconds
 [ ] How to know how long x centuries in years months weeks days hours minutes seconds
 [ ] How to know how long a years b months c weeks d days in hours minutes seconds

Ddd\Time\Tests\HowTo\TimeInterval
 [ ] How to know if a time interval is before after during an other time interval
 [ ] How to know if a time interval is before after during a given date interval
 [ ] How to know if a time interval is before after during a given date
 [ ] How to know if a time interval is before after during a given date time
 [ ] How to transform a time interval into a date interval destroy data
 [ ] How to know how long a time interval are in at least seconds minutes hours days weeks years
 [x] How to transform string representation of time interval into an object

Ddd\Time\Tests\HowTo\TimeOfDay
 [x] How to know if a time of day is before after equal an other time of day
 [x] How to know if it is the ante meridian post meridian

Ddd\Time\Tests\HowTo\TimePoint
 [x] How to know if it is before after equal an other time point
 [x] How to know if it is before after equal a given date
 [x] How to know if it is before after during a given date interval
 [ ] How to know if a it is bbefore after equal a given time interval
 [ ] How to know if it is during night or daylight
 [x] How to add remove duration from it
 [x] How to convert a ddd time point object into regular date timeobject
 [x] How to know if time point is before during after a time interval

```

Inspired by:

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.6% 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.

### Community

Maintainers

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

---

Top Contributors

[![rouffj](https://avatars.githubusercontent.com/u/24047?v=4)](https://github.com/rouffj "rouffj (12 commits)")[![inelgnu](https://avatars.githubusercontent.com/u/665908?v=4)](https://github.com/inelgnu "inelgnu (3 commits)")[![pddeguillebon](https://avatars.githubusercontent.com/u/4659303?v=4)](https://github.com/pddeguillebon "pddeguillebon (2 commits)")

### Embed Badge

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

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

###  Alternatives

[silverstripe/blog

A fresh take on blogging in Silverstripe set out to tackle the issue of a cluttered Site Tree.

102753.0k33](/packages/silverstripe-blog)[sulu/sylius-producer-plugin

Producer for synchronization products with sulu.

1044.3k](/packages/sulu-sylius-producer-plugin)

PHPackages © 2026

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