Time\Clock\ClockInterface
InterfaceSource on GitHubPhalcon\Time\Clock\ClockInterface
Uses DateTimeImmutable
Method Summary
Methods
Public · 1
now()
public function now(): DateTimeImmutable;Time\Clock\Exception
ClassSource on GitHub\ExceptionPhalcon\Time\Clock\Exception
Time\Clock\Exceptions\InvalidModifier
ClassSource on GitHub\ExceptionPhalcon\Time\Clock\ExceptionPhalcon\Time\Clock\Exceptions\InvalidModifier
Uses Phalcon\Time\Clock\Exception · Throwable
Method Summary
Methods
Public · 1
__construct()
public function __construct(
string $modifier,
Throwable|null $ex = null
);Time\Clock\FrozenClock
FinalSource on GitHubPhalcon\Time\Clock\FrozenClock- implementsPhalcon\Time\Clock\ClockInterface
Uses DateTimeImmutable · DateTimeZone · Phalcon\Time\Clock\Exceptions\InvalidModifier · Throwable
Method Summary
public__construct( DateTimeImmutable$now )publicstaticadjust( string$modifier )Mutates the clock to a new value. All consumers receive the same modificationpublicFrozenClockfromSystemTimezone()Return a new object of now with the current timezonepublicFrozenClockfromUTC()Return a new object of now with UTCpublicDateTimeImmutablenow()Return the current clockpublicstaticset( DateTimeImmutable$now )Sets the clock to a new value. All consumers receive the same modificationMethods
Public · 6
__construct()
public function __construct( DateTimeImmutable $now );adjust()
public function adjust( string $modifier ): static;Mutates the clock to a new value. All consumers receive the same modification
fromSystemTimezone()
public static function fromSystemTimezone(): FrozenClock;Return a new object of now with the current timezone
fromUTC()
public static function fromUTC(): FrozenClock;Return a new object of now with UTC
now()
public function now(): DateTimeImmutable;Return the current clock
set()
public function set( DateTimeImmutable $now ): static;Sets the clock to a new value. All consumers receive the same modification
Time\Clock\SystemClock
FinalSource on GitHubPhalcon\Time\Clock\SystemClock- implementsPhalcon\Time\Clock\ClockInterface
Uses DateTimeImmutable · DateTimeZone
Method Summary
public__construct( DateTimeZone$timezone )publicSystemClockfromSystemTimezone()Return a new object of now with the current timezonepublicSystemClockfromUTC()Return a new object of now with UTCpublicDateTimeImmutablenow()Return the current clockMethods
Public · 4
__construct()
public function __construct( DateTimeZone $timezone );fromSystemTimezone()
public static function fromSystemTimezone(): SystemClock;Return a new object of now with the current timezone
fromUTC()
public static function fromUTC(): SystemClock;Return a new object of now with UTC
now()
public function now(): DateTimeImmutable;Return the current clock