Documentation

NativeClock
in package
implements ClockInterface

FinalYes

A clock that relies the system time.

Tags
author

Nicolas Grekas p@tchwork.com

Table of Contents

Interfaces

ClockInterface

Properties

$timezone  : DateTimeZone

Methods

__construct()  : mixed
now()  : DatePoint
Returns the current time as a DateTimeImmutable Object
sleep()  : void
withTimeZone()  : static

Properties

Methods

__construct()

public __construct([DateTimeZone|string|null $timezone = null ]) : mixed
Parameters
$timezone : DateTimeZone|string|null = null
Tags
throws
DateInvalidTimeZoneException

When $timezone is invalid

sleep()

public sleep(float|int $seconds) : void
Parameters
$seconds : float|int

withTimeZone()

public withTimeZone(DateTimeZone|string $timezone) : static
Parameters
$timezone : DateTimeZone|string
Tags
throws
DateInvalidTimeZoneException

When $timezone is invalid

Return values
static

        
On this page

Search results