crutch/clock-real

real clock implementation

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

This package is not auto-updated.

Last update: 2024-12-15 19:39: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"