DateString
in package
implements
Stringable
Parse a date string and create normalized formats.
Table of Contents
Interfaces
- Stringable
Constants
- DATETIME_FORMAT = 'c'
- Date format constants
- SENTENCE_FORMAT = 'l M jS, Y, \a\t g:ia'
- SHORT_FORMAT = 'M jS, Y'
Properties
- $datetime : string
- The machine-readable datetime string.
- $dateTimeObject : DateTime
- The parsed date object.
- $sentence : string
- The human-readable sentence string.
- $short : string
- Shorter version of the sentence string.
- $string : string
- The original date string.
Methods
- __construct() : mixed
- __toString() : string
Constants
DATETIME_FORMAT
Date format constants
public
final mixed
DATETIME_FORMAT
= 'c'
SENTENCE_FORMAT
public
final mixed
SENTENCE_FORMAT
= 'l M jS, Y, \a\t g:ia'
SHORT_FORMAT
public
final mixed
SHORT_FORMAT
= 'M jS, Y'
Properties
$datetime read-only
The machine-readable datetime string.
public
string
$datetime
$dateTimeObject read-only
The parsed date object.
public
DateTime
$dateTimeObject
$sentence read-only
The human-readable sentence string.
public
string
$sentence
$short read-only
Shorter version of the sentence string.
public
string
$short
$string read-only
The original date string.
public
string
$string
Methods
__construct()
public
__construct(string $string) : mixed
Parameters
- $string : string
__toString()
public
__toString() : string