ultimate-time-ago
v1.1.4
Published
Counts how many seconds, minutes, hours, days, weeks, and years ago a date is from the current date and time.
Downloads
1
Readme
Ultimate Time Ago
ultimate-time-ago has a simple purpose: to help you count how much time has passed since today.
Features
- Pure Javascript, no dependencies.
- Works with any Javascript framework
Installation
npm
npm i ultimate-time-ago
Usage
import {timeAgo} from 'ultimate-time-ago';
const date = 1562712802175; // Can take any date format such as new Date() or Date.now();
timeAgo(date) // Will output how man seconds, minutes, hours, days, weeks, or years the specified date is from right now;
// OR you can use this way
import UTA from 'ultimate-time-ago';
const date = 1562712802175; // Can take any date format such as new Date() or Date.now();
UTA.timeAgo(date) // Will output how man seconds, minutes, hours, days, weeks, or years the specified date is from right now;