Skip to main content
Deno 2 is finally here 🎉️
Learn more
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.49/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"