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

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

arth/time-machine
=================

Abstraction for current datetime

v2.0.0(5y ago)01431MITPHPCI failing

Since Dec 12Pushed 5y agoCompare

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

READMEChangelogDependencies (2)Versions (4)Used By (1)

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

[](#timemachine)

Module for application time control for testing purpose.

Usage:

- `composer req arth/time-machine`
- replace all `new DateTime('now')` and analogues with `Arth\Utils\TimeMachine::getInstance()->getNow()`
- in tests call `Arth\Utils\TimeMachine::getInstance()->setNow($dt)` with necessary $dt object for time shift.

Changelog
---------

[](#changelog)

v1.0.0

- getNow()/setNow(DateTimeInterface)
- setFreezedMode(bool) - is time tick between getNow() calls?
- date2ts(DateTimeInterface)/ts2date($ts) with correct microseconds handling

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

Total

3

Last Release

2080d ago

Major Versions

v1.1.0 → v2.0.02020-09-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/52800?v=4)[arth](/maintainers/arth)[@arth](https://github.com/arth)

---

Top Contributors

[![vpArth](https://avatars.githubusercontent.com/u/4529061?v=4)](https://github.com/vpArth "vpArth (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[aimeos/macro

Customize classes using closures

2.3k131.7k5](/packages/aimeos-macro)[nodejs-php-fallback/stylus

PHP wrapper to execute stylus node package or fallback to a PHP alternative

11135.5k4](/packages/nodejs-php-fallback-stylus)[cityofzion/neo-php

NEO blockchain implementation for PHP

152.0k](/packages/cityofzion-neo-php)[miraheze/rotten-links

A MediaWiki extension to show the state of all external links on the wiki.

101.5k](/packages/miraheze-rotten-links)

PHPackages © 2026

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