time-passed
v0.0.5
Published
A package to calculate the time passed since another timestamp
Downloads
54
Maintainers
Readme
Time Passed
A library that helps you with showing the time passed since some other timestamp.
Helpful for posts and updates and such.
NOTE: uses millisecond Unix time
Demo
https://timepassed.robbie.digital/
Usage
Import
import Time from "time-passed";
Time.getRelativeTime(Date.now(), 1605236401152);
or in ES5
const Time = require("time-passed").default;
Time.getRelativeTime(Date.now(), 1605236401152);
or in UMD
<script src="https://unpkg.com/time-passed@0.0.3/umd/index.js"></script>
<script>
const newTime = window.TimePassed.default.getRelativeTime(Date.now(), 1605236401152);
</script>