FrozenClock
Class
implements
ClockInterface
Read only:
Yes
Final:
Yes
Provides the current system time in a predictable timezone.
Interfaces
Properties
: DateTimeImmutable
Methods
__construct()
: mixed
Creates a new frozen clock.
now()
: DateTimeImmutable
Returns the current date-time.
: DateTimeImmutable
Creates a new frozen clock.
public
__construct([DateTimeInterface|ClockInterface|string|int|float
$clock = 'now']) : mixed
Parameters
$clock
:
DateTimeInterface|ClockInterface|string|int|float
=
'now'
Description
the time to freeze, or a ClockInterface to use its current time
Returns the current date-time.
public
now() : DateTimeImmutable
Return values
DateTimeImmutable
private
fromTimestamp(
float|int
$timestamp) : DateTimeImmutable
Parameters
$timestamp
:
float|int
throws
InvalidArgumentException
Return values
DateTimeImmutable