ILIAS
release_8 Revision v8.23
◀ ilDoc Overview
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
21
use
DateTimeImmutable
;
22
use
DateTimeZone
;
23
24
class
LocalClock
implements
ClockInterface
25
{
26
private
DateTimeZone
$time_zone
;
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
}
ILIAS\Data\Clock\ClockInterface
Definition:
ClockInterface.php:23
DateTimeImmutable
DateTimeZone
ILIAS\Data\Clock\LocalClock
Definition:
LocalClock.php:24
ILIAS\Data\Clock
Definition:
ClockFactory.php:19
ILIAS\Data\Clock\LocalClock\$time_zone
DateTimeZone $time_zone
Definition:
LocalClock.php:26
ILIAS\Data\Clock\LocalClock\__construct
__construct(DateTimeZone $time_zone)
Definition:
LocalClock.php:28
ILIAS\Data\Clock\LocalClock\now
now()
Definition:
LocalClock.php:33
src
Data
Clock
LocalClock.php
Generated on Wed Sep 3 2025 22:02:50 for ILIAS by
1.8.13 (using
Doxyfile
)