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

x/netzo/auth/utils/display.ts>timeAgo

Deno-powered framework for building business web apps
Go to Latest
function timeAgo
import { timeAgo } from "https://deno.land/x/netzo@0.4.10/auth/utils/display.ts";

Returns how long ago a given date is from now.

Examples

Example 1

import { timeAgo } from "../../../../auth/utils/display.ts";
import { SECOND, MINUTE, HOUR } from "../../deps/std/datetime/constants.ts";

timeAgo(new Date()); // Returns "just now"
timeAgo(new Date(Date.now() - 3 * HOUR)); // Returns "3 hours ago"