7 Best JavaScript Timeago Plugins For Human-readable Datetime Format

by jQueryScript,

This blog post covers 7 of the best open source jQuery plugins and JavaScript libraries for formatting date and time strings. These plugins (libraries) convert raw timestamps into auto-updating and human-readable format (e.g. "30 minutes ago", "3 days ago") to provide users with relatable context about when events occurred or content was published. 

What Is Timeago?

Relative date and time strings, or "timeago" text, improves user experience by translating hardcoded dates and times into dynamic strings based on the current date. Rather than seeing "Posted on January 1, 2023," viewers see "Posted 6 months ago" — a format that is constantly self-updating and doesn't require mental math to determine when content was created. 

7 Best Time Ago JavaScript Plugins

The options featured in this list represent some of the most popular, well-supported, and full-featured relative date/time JavaScript plugins available as open source. They are ranked based on their functionality, downloads/views, popularity, and, most importantly, their effectiveness in delivering accurate relative times. Let's get started.

1. Lightweight Human Readable Date & Time Library – timeago.js

A lightweight and pure JavaScript version of the familiar jQuery timeago plugin that allows to parse and format dates & times using natural language like ‘5 minutes ago’.

Lightweight Human Readable Date & Time Library – timeago.js

[Demo] [Download]


2. Relative Timestamps Update jQuery Plugin - timeago

A smart and useful jQuery Plugin for updating fuzzy timestamps in your document automatically and intelligently. It supports almost all the major languages.

Relative Timestamps Update jQuery Plugin - timeago

[Demo] [Download]


3. User-Friendly Date Formatting Plugin - prettydate

A jQuery plugin inspired from Twitter Timeline for creating User-Friendly date formatting (x days ago, yesterday, just now, etc. ) for your projects.

User-Friendly Date Formatting Plugin - prettydate

[Demo] [Download]


4. Convert Timestamp To User-friendly Format – relative-time.js

A lightweight (less than 1kb), standalone relative time JavaScript library that converts timestamps to human-readable time format such as “5 mins ago”, “in 7 days”, and so on.

Convert Timestamp To User-friendly Format – relative-time.js

[Demo] [Download]


5. Format/Prettify/Convert Datetime - dateFormat

A small and fast JavaScript library used to format, prettify and convert datetime with different patterns.

Format/Prettify/Convert Datetime - dateFormat

[Demo] [Download]


6. Tiny Relative Time (Timeago) JavaScript Library – Lately.js

A super tiny (~ 1kb) and blazing fast timeago library that automatically shortens the Datetime (ISO 8601) into relative time (how long ago).

Tiny Relative Time (Timeago) JavaScript Library – Lately.js

[Demo] [Download]


7. Human-readable Elapsed Time - jQuery timeElapsed.js

A fast, lightweight jQuery plugin that compares the difference between two Dates and displays a human-readable string representing the amount of time that passes from the beginning of an event to its end.

Tiny Relative Time (Timeago) JavaScript Library – Lately.js

[Demo] [Download]


More Resources:

Looking for more jQuery plugins or JavaScript libraries to implement the timeago functionality on the web & mobile? See jQuery Timeago Plugin and JavaScript Timeago sections.

See Also: