SystemClock implements ClockInterface

FinalYes

Default PSR-20 clock, returning the actual current system time on every call.

This is the implementation received when injecting ClockInterface. Use it whenever the real wall-clock time matters, such as expiry of sessions or tokens - especially in long-running CLI processes, where a timestamp taken at process start goes stale. To read a consistent "time of the current request" instead, inject the concrete RequestClock class.

Table of Contents

Interfaces

ClockInterface

Methods

now()  : DateTimeImmutable

Methods

now()

public now() : DateTimeImmutable
Return values
DateTimeImmutable
On this page

Search results