navarr/specific-time

A static time and date implementation of PSR-20

Fund package maintenance!
navarr

Installs: 128

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/navarr/specific-time

v1.0.1 2025-10-06 20:49 UTC

This package is auto-updated.

Last update: 2025-10-06 20:50:23 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License
Tests Code Coverage Mutation score

This is an implementation of PSR-20 that provides a constant time, no matter how many times ->now() is called on the object.

Installation

composer require navarr/specific-time:^1

Usage

use DateTimeImmutable;
use Navarr\SpecificTime\SpecificTime;

// ...

$date = new DateTimeImmutable('2021-02-20');
$clock = new SpecificTime($date);

// 2021-02-20
echo $clock->now()->format('Y-m-d');