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

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

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function timeAgo
import { timeAgo } from "https://deno.land/x/netzo@0.4.87/plugins/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"