Time\Clock\ClockInterface
InterfaceSource on GitHubPhalcon\Time\Clock\ClockInterface
Uses DateTimeImmutable
Method Summary
Methods
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
__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 modification
publicFrozenClockfromSystemTimezone()Return a new object of now with the current timezone
publicFrozenClockfromUTC()Return a new object of now with UTC
publicDateTimeImmutablenow()Return the current clock
publicstaticset(DateTimeImmutable $now)Sets the clock to a new value. All consumers receive the same modification
Methods
__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 timezone
publicSystemClockfromUTC()Return a new object of now with UTC
publicDateTimeImmutablenow()Return the current clock
Methods
__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