Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

std/fmt/duration.ts

The Deno Standard Library
Latest
import * as mod from "https://deno.land/std@0.224.0/fmt/duration.ts";

Format milliseconds to time duration.

import { format } from "https://deno.land/std@0.224.0/fmt/duration.ts";

// "00:00:01:39:674:000:000"
format(99674, { style: "digital" });

// "0d 0h 1m 39s 674ms 0µs 0ns"
format(99674);

// "1m 39s 674ms"
format(99674, { ignoreZero: true });

// "1 minutes, 39 seconds, 674 milliseconds"
format(99674, { style: "full", ignoreZero: true });

Functions

Format milliseconds to time duration.