1.0.6 • Published 5 years ago

how-long v1.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

How long

Break down the difference between two js dates into customisable units, using this simple, fast, lightweight module.

Installation

npm install --save how-long
howLong(Date.now(), Date.now() + 61001, 'seconds')
{
  "seconds": 61
}
howLong(Date.now(), Date.now() + 61001, ['minutes', 'seconds'])
{
  "minutes": 1,
  "seconds": 1
}

If you do not specify time units, how-long will break down the difference in terms of all the time units it knows about:

howLong(Date.now(), Date.now() + 61001)
{
  "years": 0,
  "months": 0,
  "weeks": 0,
  "days": 0,
  "hours": 0,
  "minutes": 1,
  "seconds": 1,
  "milliseconds": 1
}
1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago