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

x/pup/plugins/web-interface/static/js/helpers.js>formatTime

Universal process manager built in Deno
Go to Latest
function formatTime
import { formatTime } from "https://deno.land/x/pup@1.0.0-rc.4/plugins/web-interface/static/js/helpers.js";

Converts the given seconds into a string with a time unit. The units used are years, days, hours, minutes, and seconds.

Examples

// returns "1 year, 2 days" formatTime(31539600);

// returns "3 days, 2 hours" formatTime(263000);

// returns "3 hours, 50 minutes" formatTime(13800);

Parameters

seconds
  • The number of seconds to convert.