Convert Unix Timestamp Into Human-readable Date Format – time-to-readable.js

Category: Date & Time , Javascript | January 5, 2022
Author:ShadyAssistant
Views Total:260 views
Official Page:Go to website
Last Update:January 5, 2022
License:GPL-2.0

Preview:

Convert Unix Timestamp Into Human-readable Date Format – time-to-readable.js

Description:

time-to-readable.js is a tiny and multilingual time ago JavaScript library that converts the content of an element with the “data-ago” attribute (value = UNIX milliseconds), into human-readable format such as xx days ago.

How to use it:

1. Download and import the time-to-readable.js library.

<script src="time-to-readable.min.js"></script>

2. Add UNIX timestamps to “data-ago” attribute and the library will do the rest.

<span data-ago="1639729501000">2021/12/17 15:25</span>

You Might Be Interested In:


Leave a Reply