Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/netzo/core/plugins/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.3.91/core/plugins/auth/utils/display.ts";

Returns how long ago a given date is from now.

Examples

Example 1

import { timeAgo } from "../../../../core/plugins/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"