ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
LocalClock.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
21namespace ILIAS\Data\Clock;
22
23use DateTimeImmutable;
24use DateTimeZone;
25
26class LocalClock implements ClockInterface
27{
28 private DateTimeZone $time_zone;
29
30 public function __construct(DateTimeZone $time_zone)
31 {
32 $this->time_zone = $time_zone;
33 }
34
35 public function now(): DateTimeImmutable
36 {
37 return new DateTimeImmutable('now', $this->time_zone);
38 }
39}
__construct(DateTimeZone $time_zone)
Definition: LocalClock.php:30