Time Ago
A TypeScript utility for converting timestamps into human-readable relative time strings
Installation
Usage
Basic usage with default options:
Enhanced formatting with options:
Example
Simple Time Ago
just now
8/8/2025, 9:58:27 AM
Enhanced Time Ago
just now
8/8/2025, 9:58:27 AM
API Reference
timeAgo(date)
Prop | Type | Default |
---|---|---|
date | Date | string | number | - |
formatTimeAgo(date, options)
Prop | Type | Default |
---|---|---|
short | boolean | false |
maxUnits | number | 1 |
future | boolean | true |
round | boolean | true |
Edit on GitHub
Last updated on