Skip to main content

formatMs

Callable

  • formatMs(ms: number, options?: Options): string

  • Can be used to format a UNIX timestamp in milliseconds into a shorthand human readable format. Wraps the pretty-ms package to handle infinite numbers, zeros, and more.

    import { formatMs } from '@boost/common';

    formatMs(1337000000); // 15d 11h 23m 20s