PHPackages                             bvarent/datetimems - 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. bvarent/datetimems

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

bvarent/datetimems
==================

DateTime with microseconds awareness and calculations.

v1.1.0(11y ago)3311LGPL-3.0+PHP

Since Oct 13Pushed 11y ago1 watchersCompare

[ Source](https://github.com/bvarent/datetimems)[ Packagist](https://packagist.org/packages/bvarent/datetimems)[ RSS](/packages/bvarent-datetimems/feed)WikiDiscussions master Synced 1mo ago

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

DateTimeMS
==========

[](#datetimems)

This small library enables you to make time calculations with microseconds precisions. PHP's built-in DateTime and DateInterval classes will not do that. Except that DateTime does keep microseconds, but will ignore those in its calculations.

Usage
-----

[](#usage)

Require this library via [composer](https://getcomposer.org).

Use in the same way as you would DateTime. The classes extend DateTime, so you can substitute your legacy classes where needed.

Example:

```
$dtToday = new \DateTimeMS();
$dtTomorrow = clone $dtToday;
$dtTomorrow->modify("+1 day -1 microsecond");
$interval = $dtToday->diff($dtTomorrow);
print "In between {$dtToday->format('D, H:i:s.u')} and the same second tomorrow
    are $interval->format('%d days, %h hrs, %i mins, %secs and %u microsecs')."
```

Warnings
--------

[](#warnings)

- The comparison operators (&lt; &gt; = etc) do not account for microseconds. (Which is impossible to achieve due to nonexistence of PHP operator overloading.)
- DateTimeMS::modify cannot be used to set microseconds explicitly.
- DateIntervalMS::modify is not implemented.

ToDo
----

[](#todo)

- Improve DateTimeMS::modify
- Implement DateIntervalMS::modify
- Expand the unit tests.
- Test and think about performance.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity64

Established project with proven stability

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

Total

2

Last Release

4184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0c25672fa8bfead35433ea51a84eb987ca37e930e5a46ac612eb3c0b618708f2?d=identicon)[bvarent](/maintainers/bvarent)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bvarent-datetimems/health.svg)

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

PHPackages © 2026

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