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
파일 보기 프로젝트 열기: cakephp/chronos 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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