Skip to main content
The Deno 2 Release Candidate is here
Learn more
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
class DateTimeFormatter
import { DateTimeFormatter } from "https://deno.land/std@0.100.0/datetime/formatter.ts";

Constructors

new
DateTimeFormatter(formatString: string, rules?: Rule[])

Methods

format(date: Date, options?: Options): string
parse(string: string): Date
parseToParts(string: string): DateTimeFormatPart[]
partsToDate(parts: DateTimeFormatPart[]): Date
sortDateTimeFormatPart(parts: DateTimeFormatPart[]): DateTimeFormatPart[]

sort & filter dateTimeFormatPart