PHP Класс Cake\Chronos\Date

This class is useful when you want to represent a calendar date and ignore times. This means that timezone changes take no effect as a calendar date exists in all timezones in each respective date.
Наследование: extends DateTimeImmutabl\DateTimeImmutable, implements Cake\Chronos\ChronosInterface, use trait Cake\Chronos\Traits\ComparisonTrait, use trait Cake\Chronos\Traits\DifferenceTrait, use trait Cake\Chronos\Traits\FactoryTrait, use trait Cake\Chronos\Traits\FormattingTrait, use trait Cake\Chronos\Traits\FrozenTimeTrait, use trait Cake\Chronos\Traits\MagicPropertyTrait, use trait Cake\Chronos\Traits\ModifierTrait, use trait Cake\Chronos\Traits\TestingAidTrait
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$toStringFormat string Format to use for __toString method when type juggling occurs.

Открытые методы

Метод Описание
__construct ( string | null $time = 'now', DateTimeZon\DateTimeZone | string | null $tz = null ) Create a new Immutable Date instance.
toMutable ( ) : MutableDate Create a new mutable instance from current immutable instance.

Описание методов

__construct() публичный метод

Please see the testing aids section (specifically static::setTestNow()) for more on the possibility of this constructor returning a test instance. Date instances lack time components, however due to limitations in PHP's internal Datetime object the time will always be set to 00:00:00, and the timezone will always be UTC. Normalizing the timezone allows for subtraction/addition to have deterministic results.
public __construct ( string | null $time = 'now', DateTimeZon\DateTimeZone | string | null $tz = null )
$time string | null Fixed or relative time
$tz DateTimeZon\DateTimeZone | string | null The timezone for the instance

toMutable() публичный метод

Create a new mutable instance from current immutable instance.
public toMutable ( ) : MutableDate
Результат MutableDate

Описание свойств

$toStringFormat защищенное статическое свойство

Format to use for __toString method when type juggling occurs.
protected static string $toStringFormat
Результат string