View as Markdown

API reference: @salmonui/core/dates

toDatefunction

import { toDate } from '@salmonui/core/dates';
function toDate(value: PlainDateLike & Partial<PlainTimeLike>, timeZone?: string): Date;

The Date (instant) of a plain date or date-time: its wall time in timeZone (DST resolved like Temporal 'compatible'), else in the host zone. An invalid value or zone gives an invalid Date.