Skip to content

Phalcon time

NOTE

All classes are prefixed with Phalcon

Time\Clock\ClockInterface

Interface Source on GitHub

  • Phalcon\Time\Clock\ClockInterface

Uses DateTimeImmutable

Method Summary

Methods

Public · 1

now()

public function now(): DateTimeImmutable;

Time\Clock\Exception

Class Source on GitHub

Time\Clock\Exceptions\InvalidModifier

Class Source on GitHub

Uses Phalcon\Time\Clock\Exception · Throwable

Method Summary

Methods

Public · 1

__construct()

public function __construct(
    string $modifier,
    Throwable $ex = null
);

Time\Clock\FrozenClock

Final Source 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

Final Source 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