StringTemporalParts
Read onlyYes
FinalYes
Methods
- __construct() : mixed
- from() : self
- One date_parse() for both temporal rungs; running it per rung cost ~90% of narrow() on non-temporal cells.
- hasExplicitDay() : bool
- date_parse() defaults a missing day to 1, so '2024-01' is indistinguishable from '2024-01-01' by its parts alone and a month-precision column would be typed date with a fabricated day. The day has to be read back out of the input: three numeric groups, or two plus a spelled-out month ('02-Jun-2022').
- isDate() : bool
- isDateTime() : bool
Methods
__construct()
public
__construct(bool $calendarDate, bool $explicitDay, bool $time) : mixed
Parameters
- $calendarDate : bool
- $explicitDay : bool
- $time : bool
from()
One date_parse() for both temporal rungs; running it per rung cost ~90% of narrow() on non-temporal cells.
public
static from(string $value) : self
Parameters
- $value : string
Return values
selfhasExplicitDay()
date_parse() defaults a missing day to 1, so '2024-01' is indistinguishable from '2024-01-01' by its parts alone and a month-precision column would be typed date with a fabricated day. The day has to be read back out of the input: three numeric groups, or two plus a spelled-out month ('02-Jun-2022').
public
static hasExplicitDay(string $value) : bool
Compact ISO ('20240305') is one group and a real calendar date; from()'s checkdate() gate keeps '12345678' and friends out, so the widening is exactly that one form.
Parameters
- $value : string
Return values
boolisDate()
public
isDate() : bool
Return values
boolisDateTime()
public
isDateTime() : bool