DateField
extends DateTimeField
in package
Класс для работы с полями типа datatime
Tags
Table of Contents
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
$defaultLocale
public
static mixed
$defaultLocale
= null
Methods
__construct()
public
__construct(mixed $data[, Storage|null $storage = null ][, Field|null $field = null ]) : mixed
Parameters
__toString()
Return Date in ISO8601 format
public
__toString() : string
Return values
stringdiff()
Return difference between $this and $now
public
diff(DateTimeInterface|string $object[, bool $absolute = NULL ]) : DateInterval
Parameters
- $object : DateTimeInterface|string
- $absolute : bool = NULL
Return values
DateIntervalformat()
public
format(string $format[, string|null $locale = null ]) : string
Parameters
- $format : string
- $locale : string|null = null
Return values
stringgetAge()
Return Age in Years
public
getAge([DateTime|string $now = 'NOW' ]) : int
Parameters
- $now : DateTime|string = 'NOW'
Return values
intjsonSerialize()
public
jsonSerialize() : string