Function: consumeDateTime()
Call Signature
ts
function consumeDateTime(
key: string,
value: unknown,
nullable: true,
): DateTime<boolean> | null;Consumes a datetime value from database results with nullable support and enhanced string parsing
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The field name for error reporting |
value | unknown | The value to consume |
nullable | true | Whether the field can be null |
Returns
| DateTime<boolean> | null
The consumed DateTime value or null if nullable and value is null
Throws
E_INVALID_CONSUMED_VALUE when the value cannot be consumed
Remarks
For string values, attempts SQL format parsing first, then falls back to ISO format parsing
Call Signature
ts
function consumeDateTime(
key: string,
value: unknown,
nullable?: false,
): DateTime;Consumes a datetime value from database results with nullable support and enhanced string parsing
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | The field name for error reporting |
value | unknown | The value to consume |
nullable? | false | Whether the field can be null |
Returns
The consumed DateTime value or null if nullable and value is null
Throws
E_INVALID_CONSUMED_VALUE when the value cannot be consumed
Remarks
For string values, attempts SQL format parsing first, then falls back to ISO format parsing