Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

toDate

import { toDate } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Clone the date:
const result = toDate(new Date(2014, 1, 11, 11, 30, 30))
//=> Tue Feb 11 2014 11:30:30
@example
// Convert the timestamp to date:
const result = toDate(1392098430000)
//=> Tue Feb 11 2014 11:30:30
function toDate<DateType extends Date>(argument: DateType | number | string): DateType;
§
toDate<DateType extends Date>(argument: DateType | number | string): DateType
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
argument: DateType | number | string
[src]
  • The value to convert

§Return Type

§
DateType
[src]

The parsed date in the local time zone