crutch/clock-real

real clock implementation

Installs: 33

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/crutch/clock-real

v1.0.0 2023-02-11 12:08 UTC

This package is not auto-updated.

Last update: 2025-10-20 00:01:09 UTC


README

Real Clock implementation

Install

composer require crutch/clock-real

Usage

<?php

$clock1 = new \Crutch\RealClock\RealClock();

$time1 = $clock1->now();
var_dump($time1->getTimezone()->getName()); // "UTC"

// Default timezone
$clock2 = new \Crutch\RealClock\RealClock(new DateTimeZone('Pacific/Tarawa'));

$time2 = $clock2->now();
var_dump($time2->getTimezone()->getName()); // "Pacific/Tarawa"