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
3/25/2025, 6:06:24 PM
Enhanced Time Ago
just now
3/25/2025, 6:06:24 PM
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