Documentation

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

$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

format()

public format() : string
Return values
string

escapeSingleCharacter()

protected escapeSingleCharacter(string $value) : string
Parameters
$value : string
Return values
string

intersperse()

protected intersperse(string $formatBlock, string|null $separator) : string
Parameters
$formatBlock : string
$separator : string|null
Return values
string

padSeparatorArray()

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
string

        
On this page

Search results