for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace EventSauce\EventSourcing\Time;
use DateTimeImmutable;
use DateTimeZone;
class SystemClock implements Clock
{
private DateTimeZone $timeZone;
public function __construct(DateTimeZone $timeZone = null)
$this->timeZone = $timeZone ?: new DateTimeZone('UTC');
}
public function now(): DateTimeImmutable
return new DateTimeImmutable('now', $this->timeZone);
public function timeZone(): DateTimeZone
return $this->timeZone;