Date
extends DateTime
in package
implements
JsonSerializable, Stringable
Class Date.
Tags
Interfaces, Classes, Traits and Enums
- JsonSerializable
- Stringable
Table of Contents
- DATETIME = 'Y-m-d H:i:s'
- $language : Language
- __construct() : mixed
- __toString() : string
- createFromFormat() : false|static
- Parse a string into a new static object according to the specified format.
- createFromImmutable() : static
- getLanguage() : Language
- humanize() : string
- jsonSerialize() : string
- setLanguage() : static
Constants
DATETIME
public
mixed
DATETIME
= 'Y-m-d H:i:s'
Properties
$language
protected
Language
$language
Methods
__construct()
public
final __construct([string $datetime = 'now' ][, DateTimeZone|null $timezone = null ][, Language|null $language = null ]) : mixed
Parameters
- $datetime : string = 'now'
- $timezone : DateTimeZone|null = null
- $language : Language|null = null
Return values
mixed —__toString()
public
__toString() : string
Return values
string —createFromFormat()
Parse a string into a new static object according to the specified format.
public
static createFromFormat(string $format, string $datetime[, DateTimeZone|null $timezone = null ]) : false|static
Parameters
- $format : string
-
Format accepted by date()
- $datetime : string
-
A string representing the time
- $timezone : DateTimeZone|null = null
-
A DateTimeZone object representing the desired time zone
Tags
Return values
false|static —createFromImmutable()
public
static createFromImmutable(DateTimeImmutable $object) : static
Parameters
- $object : DateTimeImmutable
Tags
Return values
static —getLanguage()
public
getLanguage() : Language
Return values
Language —humanize()
public
humanize() : string
Return values
string —jsonSerialize()
public
jsonSerialize() : string
Return values
string —setLanguage()
public
setLanguage(Language $language) : static
Parameters
- $language : Language