Function: castValueAsDateTime()
ts
function castValueAsDateTime(value: unknown): DateTime;Casts an unknown value to a Luxon DateTime with enhanced error handling and string parsing
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to cast (string, number, Date, or DateTime) |
Returns
The value as a Luxon DateTime
Throws
E_UNCASTABLE when the value cannot be cast to a DateTime
Remarks
For string values, attempts SQL format parsing first, then falls back to ISO format parsing