toDate()
function toDate(value): Date | null;Converts a value to a Date. Accepts Date objects, epoch milliseconds and date strings. Date-only ISO strings (“2026-03-01”) are read as local midnight, not UTC, so they do not shift by a day in western time zones. Returns null when the value is not a valid date.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
value |
unknown |
Returns
Section titled “Returns”Date | null