time-passed
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

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> 

Package Sidebar

Install

npm i time-passed

Weekly Downloads

14

Version

0.0.5

License

MIT

Unpacked Size

29.4 kB

Total Files

16

Last publish

Collaborators

  • robbie-cook