crutch/clock-real

real clock implementation

Maintainers

Package info

github.com/php-crutch/clock-real

pkg:composer/crutch/clock-real

Statistics

Installs: 33

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is not auto-updated.

Last update: 2026-03-09 01:36:03 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"