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

formatISODuration

import { formatISODuration } from "https://esm.sh/v135/date-fns@3.6.0/index.d.mts";
@example
// Format the given duration as ISO 8601 string
const result = formatISODuration({
  years: 39,
  months: 2,
  days: 20,
  hours: 7,
  minutes: 5,
  seconds: 0
})
//=> 'P39Y2M20DT0H0M0S'
function formatISODuration(duration: Duration): string;
§
formatISODuration(duration: Duration): string
[src]

§Parameters

§
duration: Duration
[src]
  • The duration to format

§Return Type

§
string
[src]

The ISO 8601 duration string