Time extends DateTimeWizard
Table of Contents
- HOURS_LONG = 'hh'
- Hours with a leading zero, e.g. 09.
- HOURS_SHORT = 'h'
- Hours without a leading zero, e.g. 9.
- MINUTES_LONG = 'mm'
- Minutes with a leading zero, e.g. 05.
- MINUTES_SHORT = 'm'
- Minutes without a leading zero, e.g. 5.
- MORNING_AFTERNOON = 'AM/PM'
- SECONDS_LONG = 'ss'
- Seconds with a leading zero, e.g. 02.
- SECONDS_SHORT = 's'
- Seconds without a leading zero, e.g. 2.
- SEPARATOR_COLON = ':'
- SEPARATOR_SPACE = ' '
- SEPARATOR_SPACE_NONBREAKING = " "
- NO_ESCAPING_NEEDED = "$+-/():!^&'~{}<>= "
- TIME_BLOCKS = [self::HOURS_LONG, self::HOURS_SHORT, self::MINUTES_LONG, self::MINUTES_SHORT, self::SECONDS_LONG, self::SECONDS_SHORT, self::MORNING_AFTERNOON]
- TIME_DEFAULT = [self::HOURS_LONG, self::MINUTES_LONG, self::SECONDS_LONG]
- $formatBlocks : array<string|int, mixed>
- $separators : array<string|int, mixed>
- __construct() : mixed
- __toString() : string
- format() : string
- escapeSingleCharacter() : string
- intersperse() : string
- padSeparatorArray() : array<string|int, mixed>
- wrapLiteral() : string
- mapFormatBlocks() : string
Constants
HOURS_LONG
Hours with a leading zero, e.g. 09.
public
mixed
HOURS_LONG
= 'hh'
HOURS_SHORT
Hours without a leading zero, e.g. 9.
public
mixed
HOURS_SHORT
= 'h'
MINUTES_LONG
Minutes with a leading zero, e.g. 05.
public
mixed
MINUTES_LONG
= 'mm'
MINUTES_SHORT
Minutes without a leading zero, e.g. 5.
public
mixed
MINUTES_SHORT
= 'm'
MORNING_AFTERNOON
public
mixed
MORNING_AFTERNOON
= 'AM/PM'
SECONDS_LONG
Seconds with a leading zero, e.g. 02.
public
mixed
SECONDS_LONG
= 'ss'
SECONDS_SHORT
Seconds without a leading zero, e.g. 2.
public
mixed
SECONDS_SHORT
= 's'
SEPARATOR_COLON
public
mixed
SEPARATOR_COLON
= ':'
SEPARATOR_SPACE
public
mixed
SEPARATOR_SPACE
= ' '
SEPARATOR_SPACE_NONBREAKING
public
mixed
SEPARATOR_SPACE_NONBREAKING
= " "
NO_ESCAPING_NEEDED
protected
mixed
NO_ESCAPING_NEEDED
= "$+-/():!^&'~{}<>= "
TIME_BLOCKS
protected
mixed
TIME_BLOCKS
= [self::HOURS_LONG, self::HOURS_SHORT, self::MINUTES_LONG, self::MINUTES_SHORT, self::SECONDS_LONG, self::SECONDS_SHORT, self::MORNING_AFTERNOON]
TIME_DEFAULT
protected
mixed
TIME_DEFAULT
= [self::HOURS_LONG, self::MINUTES_LONG, self::SECONDS_LONG]
Properties
$formatBlocks
protected
array<string|int, mixed>
$formatBlocks
$separators
protected
array<string|int, mixed>
$separators
Methods
__construct()
public
__construct([null|string|array<string|int, string> $separators = self::SEPARATOR_COLON ], string ...$formatBlocks) : mixed
Parameters
- $separators : null|string|array<string|int, string> = self::SEPARATOR_COLON
-
If you want to use the same separator for all format blocks, then it can be passed as a string literal; if you wish to use different separators, then they should be passed as an array. If you want to use only a single format block, then pass a null as the separator argument
- $formatBlocks : string
Return values
mixed —__toString()
public
__toString() : string
Return values
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 —mapFormatBlocks()
private
mapFormatBlocks(string $value) : string
Parameters
- $value : string