thesis/clock

Thesis Clock

0.1.0 2025-05-09 14:33 UTC

This package is auto-updated.

Last update: 2025-05-09 14:34:55 UTC


README

PHP Version Requirement GitHub Release Code Coverage Mutation testing badge

Installation

composer require thesis/clock

Usage

WallClock is a basic implementation of the Psr\Clock\ClockInterface that returns the current wall-clock time.

use Thesis\Time\WallClock;

$clock = new WallClock();

echo $clock->now()->format('c'); // Outputs current time in ISO 8601 format

Or with a specific timezone:

$clock = new WallClock(new DateTimeZone('Europe/Moscow'));

echo $clock->now()->format('c'); // Outputs Moscow time in ISO 8601 format