Documentation

DateTimeField extends DateTime implements JsonSerializable

Класс для работы с полями типа datatime

Tags
author

Vahan P. Grigoryan

Table of Contents

Interfaces

JsonSerializable

Properties

$defaultLocale  : mixed

Methods

__construct()  : mixed
__toString()  : string
Return Date in ISO8601 format
diff()  : DateInterval
Return difference between $this and $now
format()  : string
getAge()  : int
Return Age in Years
jsonSerialize()  : string

Properties

Methods

__construct()

public __construct(mixed $data[, Storage|null $storage = null ][, Field|null $field = null ]) : mixed
Parameters
$data : mixed
$storage : Storage|null = null
$field : Field|null = null

__toString()

Return Date in ISO8601 format

public __toString() : string
Return values
string

diff()

Return difference between $this and $now

public diff(DateTimeInterface|string $object[, bool $absolute = NULL ]) : DateInterval
Parameters
$object : DateTimeInterface|string
$absolute : bool = NULL
Return values
DateInterval

format()

public format(string $format[, string|null $locale = null ]) : string
Parameters
$format : string
$locale : string|null = null
Return values
string

getAge()

Return Age in Years

public getAge([DateTime|string $now = 'NOW' ]) : int
Parameters
$now : DateTime|string = 'NOW'
Return values
int

jsonSerialize()

public jsonSerialize() : string
Return values
string

        
On this page

Search results