Express the elapsed difference between two instants as an English label such as “2 days ago.”
The frame below runs the same code as this page, in the reader's own browser. Nothing is sent to us, and nothing is sent to you.
Pick a dark background and the text and panels follow it, so the frame stays readable on a dark page.
The target timestamp is subtracted from the current or supplied reference timestamp, then the absolute difference is floored through seconds, minutes, hours, days, weeks, approximate months, and approximate years. The threshold selects the displayed unit and the sign chooses ago or from now.
Input: 2026-01-13T12:00:00Z Reference time: 2026-01-15T12:00:00Z
2 days ago (2026-01-13T12:00:00.000Z)
Activity feeds label saved timestamps, release dashboards show time before an ISO deployment instant, and log viewers turn Unix timestamps into age labels.