final class SystemClock implements ClockInterface (View source)

Reads wall-clock time in an explicitly configured timezone or PHP's current default timezone.

Methods

__construct(DateTimeZone|null $timezone = null)

Selects the timezone applied to generated timestamps while leaving the PHP default untouched.

now()

Returns a new immutable timestamp for the current system time.

Details

__construct

__construct(DateTimeZone|null $timezone = null)

Selects the timezone applied to generated timestamps while leaving the PHP default untouched.

Parameters

DateTimeZone|null $timezone

now

Returns a new immutable timestamp for the current system time.

Return Value

DateTimeImmutable