time-diff-for-humans
v1.0.3
Published
get a difference between 2 dates in human readable format
Downloads
11
Maintainers
Readme
time-diff-for-humans
get difference between 2 dates in a human readable format, in javascript
Getting Started
run
npm i time-diff-for-humans
const timeDiff = require("time-diff-for-humans");
or
import timeDiff from "time-diff-for-humans";
timeDiff('2022-07-21 12:28:57'); // returns '7 hours ago'
timeDiff("2022-07-21 19:28:57"); // '58 minutes ago'
timeDiff("2022-03-21"); // '4 months ago'
timeDiff("2021-03-21"); // '1 year ago'
timeDiff("2022-07-21 19:28:57", "ka"); //returns '1 საათის წინ'