Date
class Date (View source)
The core parser for all Date content.
Properties
protected string|null | $datestamp | The input datestamp. | |
protected string|null | $outputTimezone | The desired output timezone. | |
protected string|null | $createFromFormat | The format used to assist date string parsing. | |
protected bool|DateTime | $dateTime | The resulting DateTime object. |
Methods
__construct(string|null $datestamp = null, string|null $outputTimezone = 'UTC', string|null $createFromFormat = null)
Constructs a new instance of this class.
string
getDatestamp()
Get the input datestamp.
string
getOutputTimezone()
Get the requested output timezone.
string|null
getCreateFromFormat()
Get the format used to assist date string parsing.
DateTime|null
getDateTime()
Get the resulting DateTime
object. If the date string could not be parsed, false
will be returned.
Details
at line 76
__construct(string|null $datestamp = null, string|null $outputTimezone = 'UTC', string|null $createFromFormat = null)
Constructs a new instance of this class.
Timezone calculation is performed on a best-effort basis and is not guaranteed. Factors which may affect the calculation include:
- the version of glibc/musl that your OS relies on.
- the freshness of the timestamp data your OS relies on.
- the format of the datestamp inside of the feed and PHP's ability to parse it.
at line 120
string
getDatestamp()
Get the input datestamp.
at line 128
string
getOutputTimezone()
Get the requested output timezone.
at line 136
string|null
getCreateFromFormat()
Get the format used to assist date string parsing.