Aplus Framework Docs

Date extends DateTime
in package
implements JsonSerializable, Stringable

Class Date.

Tags
see
https://www.php.net/manual/en/intldateformatter.format.php#106070
see
https://www.php.net/manual/en/intldateformatter.format.php#refsect1-intldateformatter.format-changelog
see
https://www.php.net/manual/en/function.strftime.php

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

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
throws
Exception

Emits Exception in case of an error

Return values
false|static

createFromImmutable()

public static createFromImmutable(DateTimeImmutable $object) : static
Parameters
$object : DateTimeImmutable
Tags
throws
Exception

Emits Exception in case of an error

Return values
static

humanize()

public humanize() : string
Return values
string

jsonSerialize()

public jsonSerialize() : string
Return values
string

setLanguage()

public setLanguage(Language $language) : static
Parameters
$language : Language
Return values
static

Search results