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

formatRFC3339

import { formatRFC3339 } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Represent 18 September 2019 in RFC 3339 format:
formatRFC3339(new Date(2019, 8, 18, 19, 0, 52))
//=> '2019-09-18T19:00:52Z'
@example
// Represent 18 September 2019 in RFC 3339 format, 3 digits of second fraction
formatRFC3339(new Date(2019, 8, 18, 19, 0, 52, 234), {
  fractionDigits: 3
})
//=> '2019-09-18T19:00:52.234Z'
function formatRFC3339<DateType extends Date>(date: DateType | number | string, options?: FormatRFC3339Options): string;
§
formatRFC3339<DateType extends Date>(date: DateType | number | string, options?: FormatRFC3339Options): string
[src]

§Type Parameters

§
DateType extends Date
[src]

§Parameters

§
date: DateType | number | string
[src]
  • The original date
§
options?: FormatRFC3339Options optional
[src]
  • An object with options.

§Return Type

§
string
[src]

The formatted date string