DateTime
extends DateTimeWizard
in package
Table of Contents
Constants
- NO_ESCAPING_NEEDED = "\$+-/():!^&'~{}<>= "
Properties
- $formatBlocks : array<string|int, DateTimeWizard|string>
- $separators : array<string|int, string>
Methods
- __construct() : mixed
- __toString() : string
- format() : string
- escapeSingleCharacter() : string
- intersperse() : string
- padSeparatorArray() : array<string|int, mixed>
- wrapLiteral() : string
- mapFormatBlocks() : string
Constants
NO_ESCAPING_NEEDED
protected
mixed
NO_ESCAPING_NEEDED
= "\$+-/():!^&'~{}<>= "
Properties
$formatBlocks
protected
array<string|int, DateTimeWizard|string>
$formatBlocks
$separators
protected
array<string|int, string>
$separators
Methods
__construct()
public
__construct(null|string|array<string|int, string> $separators, DateTimeWizard|string ...$formatBlocks) : mixed
Parameters
- $separators : null|string|array<string|int, string>
-
If you want to use only a single format block, then pass a null as the separator argument
- $formatBlocks : DateTimeWizard|string
__toString()
public
__toString() : string
Return values
stringformat()
public
format() : string
Return values
stringescapeSingleCharacter()
protected
escapeSingleCharacter(string $value) : string
Parameters
- $value : string
Return values
stringintersperse()
protected
intersperse(string $formatBlock, string|null $separator) : string
Parameters
- $formatBlock : string
- $separator : string|null
Return values
stringpadSeparatorArray()
protected
padSeparatorArray(array<string|int, mixed> $separators, int $count) : array<string|int, mixed>
Parameters
- $separators : array<string|int, mixed>
- $count : int
Return values
array<string|int, mixed>wrapLiteral()
protected
wrapLiteral(string $value) : string
Parameters
- $value : string
Return values
stringmapFormatBlocks()
private
mapFormatBlocks(DateTimeWizard|string $value) : string
Parameters
- $value : DateTimeWizard|string