ILIAS  release_8 Revision v8.23
LocalClock.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /******************************************************************************
6  *
7  * This file is part of ILIAS, a powerful learning management system.
8  *
9  * ILIAS is licensed with the GPL-3.0, you should have received a copy
10  * of said license along with the source code.
11  *
12  * If this is not the case or you just want to try ILIAS, you'll find
13  * us at:
14  * https://www.ilias.de
15  * https://github.com/ILIAS-eLearning
16  *
17  *****************************************************************************/
18 
19 namespace ILIAS\Data\Clock;
20 
22 use DateTimeZone;
23 
24 class LocalClock implements ClockInterface
25 {
27 
28  public function __construct(DateTimeZone $time_zone)
29  {
30  $this->time_zone = $time_zone;
31  }
32 
33  public function now(): DateTimeImmutable
34  {
35  return new DateTimeImmutable('now', $this->time_zone);
36  }
37 }
__construct(DateTimeZone $time_zone)
Definition: LocalClock.php:28