Skip to content

Phalcon time

NOTE

All classes are prefixed with Phalcon

Time\Clock\ClockInterface

Interface Source on GitHub

This file is part of the Phalcon Framework.

(c) Phalcon Team team@phalcon.io

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Implementation of this file has been influenced by lcobucci/clock

@link https://github.com/lcobucci/clock @license https://github.com/lcobucci/clock/blob/3.7.x/LICENSE

  • Phalcon\Time\Clock\ClockInterface

Uses DateTimeImmutable

Method Summary

Methods

Public · 1

now()

public function now(): DateTimeImmutable;

Time\Clock\Exception

Class Source on GitHub

This file is part of the Phalcon Framework.

(c) Phalcon Team team@phalcon.io

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Implementation of this file has been influenced by lcobucci/clock

@link https://github.com/lcobucci/clock @license https://github.com/lcobucci/clock/blob/3.7.x/LICENSE

Time\Clock\Exceptions\InvalidModifier

Class Source on GitHub

This file is part of the Phalcon Framework.

(c) Phalcon Team team@phalcon.io

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Implementation of this file has been influenced by lcobucci/clock

@link https://github.com/lcobucci/clock @license https://github.com/lcobucci/clock/blob/3.7.x/LICENSE

Uses Phalcon\Time\Clock\Exception · Throwable

Method Summary

Methods

Public · 1

__construct()

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

Time\Clock\FrozenClock

Final Source on GitHub

This file is part of the Phalcon Framework.

(c) Phalcon Team team@phalcon.io

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Implementation of this file has been influenced by lcobucci/clock

@link https://github.com/lcobucci/clock @license https://github.com/lcobucci/clock/blob/3.7.x/LICENSE

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

This file is part of the Phalcon Framework.

(c) Phalcon Team team@phalcon.io

For the full copyright and license information, please view the LICENSE.txt file that was distributed with this source code.

Implementation of this file has been influenced by lcobucci/clock

@link https://github.com/lcobucci/clock @license https://github.com/lcobucci/clock/blob/3.7.x/LICENSE

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