Author: | Titanium2099 |
---|---|
Views Total: | 158 views |
Official Page: | Go to website |
Last Update: | September 8, 2021 |
License: | MIT |
Preview:

Description:
A super tiny (less than 1kb) time ago (also called relative time) JavaScript library.
It automatically converts timestamps to a human-readable format with live update, such as “right now”, “3 Days ago”, etc.
See Also:
- Lightweight Human Readable Date & Time Library – timeago.js
- Relative Timestamps Update Plugin – timeago
How to use it:
1. Import the timeago.js library.
<script src="timeago.js"></script>
2. Create a new instance of the timeago.js.
const instance = new timeago();
3. Convert a datetime string into a human-readable format.
instance.timeago(Date.now()) => Right Now
instance.timeago(Date.parse('01 Jan 1970 00:00:00 GMT')) => about 51 years ago