Skip to content

Phalcon Time

Updated View as Markdown

Time\Clock\ClockInterface

InterfaceSource on GitHub
  • Phalcon\Time\Clock\ClockInterface

Uses DateTimeImmutable

Method Summary

Methods

Public · 1

now()

public function now(): DateTimeImmutable;

Time\Clock\Exception

ClassSource on GitHub

Time\Clock\Exceptions\InvalidModifier

ClassSource on GitHub

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 GitHub

Uses DateTimeImmutable · DateTimeZone · Phalcon\Time\Clock\Exceptions\InvalidModifier · Throwable

Method Summary

Methods

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 GitHub

Uses DateTimeImmutable · DateTimeZone

Method Summary

Methods

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

Type to search…

↑↓ navigate↵ selectEsc close