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

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

simplecomplex/time
==================

Time extends native DateTime class to fix shortcomings and defects, and provide more, simpler and safer getters and setters

1.2.0(5y ago)0321MITPHPCI failing

Since Jun 26Pushed 5y ago2 watchersCompare

[ Source](https://github.com/simplecomplex/php-time)[ Packagist](https://packagist.org/packages/simplecomplex/time)[ Docs](https://github.com/simplecomplex/php-time)[ RSS](/packages/simplecomplex-time/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (8)Used By (1)

(PHP) Time
==========

[](#php-time)

composer namespace: simplecomplex/**time**

- [Requirements](#Requirements)
- [License](#MIT-licensed)

### [Time](src/Time.php)

[](#time)

extends native \\DateTime to fix shortcomings and defects, and provide more properties, getters and setters.

Features
--------

[](#features)

- enhanced timezone awareness
- diff which works correctly with non-UTC timezones
- safer formatting and modifying
- is stringable (sic!), to ISO-8601
- JSON serializes to string ISO-8601 with timezone marker
- freezable
- directly accessible time part properties
- more, simpler and safer getters and setters

Related classes
---------------

[](#related-classes)

### [TimeInterval](src/TimeInterval.php)

[](#timeinterval)

has the same properties as native `\DateInterval` plus **signed relatives and totals**, and works with non-UTC timezones.

#### Time::diffTime()

[](#timedifftime)

returns interval with actual differences.

#### Time::diffDstIgnorant()

[](#timediffdstignorant)

returns an interval which ignores daylight saving time shift.
In everyday business you often don't want the difference between a date *outside* daylight saving time (DST)
and a date *inside* DST to be off by the DST offset.
That offset can be particularly nasty if either of the dates is *at* or *close to* midnight,
because then the *days* difference may get 1 off.

### [TimeSpan](src/TimeSpan.php)

[](#timespan)

It's main feature is to check **overlap** vs. another TimeSpan.

### [TimeImmutable](src/TimeImmutable.php)

[](#timeimmutable)

Is an immutable extending Time, not `\DateTimeImmutable`.

### [TimeLocal](src/TimeLocal.php)

[](#timelocal)

Forces instances to be in local (default) timezone.

Requirements
------------

[](#requirements)

- PHP &gt;=7.2 (64-bit)

### Development requirements

[](#development-requirements)

- [PHPUnit](https://github.com/sebastianbergmann/phpunit) ^8 || ^9
- [Jasny PHPUnit extension](https://github.com/jasny/phpunit-extension) ^0.2

### Suggestions

[](#suggestions)

- [SimpleComplex Inspect](https://github.com/simplecomplex/inspect)

MIT licensed
------------

[](#mit-licensed)

[License and copyright](https://github.com/simplecomplex/php-time/blob/master/LICENSE). [Explained](https://tldrlegal.com/license/mit-license).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

4

Last Release

1844d ago

### Community

Maintainers

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

---

Top Contributors

[![jacobfriis](https://avatars.githubusercontent.com/u/3807905?v=4)](https://github.com/jacobfriis "jacobfriis (72 commits)")

---

Tags

phpdatetimetimeutils

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[pocketmine/pocketmine-mp

A server software for Minecraft: Bedrock Edition written in PHP

3.5k78.3k90](/packages/pocketmine-pocketmine-mp)[kartik-v/php-date-formatter

A Javascript datetime formatting and manipulation library using PHP date-time formats.

461.6M3](/packages/kartik-v-php-date-formatter)[dater/dater

Compact PHP library for working with date/time in different formats &amp; timezones.

14484.2k](/packages/dater-dater)[zjkal/time-helper

一个简单快捷的PHP日期时间助手类库。 a smart PHP datetime helper library.

21031.2k2](/packages/zjkal-time-helper)[danielstjules/php-pretty-datetime

Generates human-readable strings for PHP DateTime objects

5899.2k](/packages/danielstjules-php-pretty-datetime)

PHPackages © 2026

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