PHPackages                             alecwcp/date-time-separation - 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. alecwcp/date-time-separation

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

alecwcp/date-time-separation
============================

A library for handling dates and times as distinct, separate objects.

10PHPCI failing

Since Mar 14Pushed 6y ago1 watchersCompare

[ Source](https://github.com/alecwcp/date-time-separation)[ Packagist](https://packagist.org/packages/alecwcp/date-time-separation)[ RSS](/packages/alecwcp-date-time-separation/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Date Time Separation
====================

[](#date-time-separation)

#### Background

[](#background)

Handling date-times in PHP can be done with "relative" ease through usage of the in-built `date` and `date_*`functions, the `DateTime` and `DateTime` classes, or even with useful libraries like [Carbon](https://carbon.nesbot.com/docs/).

Dealing with dates and times as separate entities remains awkward. A common solution is to use the date-time objects still and just ignore either the date or time part respectively - however, this then requires better variable naming, additional comments, doesn't give any extra type safety and makes comparisons harder.

This library aims to make dealing with dates and times as separate entities simple by providing 2 slim interfaces which are very similar to the core `DateTimeInterface` and 2 simple classes which implement these interfaces and provide a few convenience methods based on `DateTimeImmutable`.

#### Internals

[](#internals)

The internals of the library lean heavily on `DateTimeImmutable` to handle formatting etc.

#### Extending

[](#extending)

Extenders can either implement the interfaces provided here, or extend the simple classes provided here (within the classes all references are to `static` rather than `self` to allow easily overriding their behaviour).

#### Contributing

[](#contributing)

This library adheres to the PSR12 coding standard. Run the style check by running

```
./vendor/bin/phpcs --standard="phpcs.xml" src

```

This library uses [Psalm](https://psalm.dev/docs/) for static analysis. Run the analyzer by running

```
./vendor/bin/psalm

```

This library uses [PHPUnit](https://phpunit.readthedocs.io/en/8.0/) for testing. Run the tests by running

```
./vendor/bin/phpunit tests

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

[![alecwcp](https://avatars.githubusercontent.com/u/46442391?v=4)](https://github.com/alecwcp "alecwcp (13 commits)")

### Embed Badge

![Health badge](/badges/alecwcp-date-time-separation/health.svg)

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

###  Alternatives

[foxy/foxy

Fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer

177287.5k25](/packages/foxy-foxy)[elijaa/phpmemcacheadmin

Graphic stand-alone administration for memcached

2618.4k](/packages/elijaa-phpmemcacheadmin)[mateffy/laravel-introspect

Analyze Laravel codebases and find structured information about models, routes and other Laravel-specific things.

1698.7k2](/packages/mateffy-laravel-introspect)

PHPackages © 2026

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