PHP Класс Cake\Chronos\MutableDate

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 DateTim\DateTime, 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 mutable Date instance.
toImmutable ( ) : Date Create a new immutable instance from current mutable 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

toImmutable() публичный Метод

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

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

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

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