function formatTimeAgo
formatTimeAgo(
iso: string,
nowMsValue: number,
): string | null

Human "time ago" label for a past ISO timestamp, relative to nowMsValue (epoch ms), via Intl.RelativeTimeFormat in the largest whole unit that applies — e.g. "now", "5 minutes ago", "yesterday", "2 days ago". Returns null for an unparseable or future timestamp.

Parameters

iso: string
nowMsValue: number

Return Type

string | null

Usage

import { formatTimeAgo } from "doc.ts";