dateween

1.0.3 • Public • Published

What is this?

Get the number of days (or seconds, minutes etc.) between two dates in JavaScript.

Installation

npm i dateween --save

Usage

const dateween = require('dateween');

console.log(dateween.getDays("2021-12-3", "2020-1-24"));
/*
    output -> 679
*/

console.log(dateween.getAllInOne("2021-12-3", "2020-1-24"));
/*
    output ->
    AllInOne {
        year: 1.8602739726027397,
        month: 22.633333333333333,
        week: 97,
        day: 679,
        minute: 977760,
        second: 58665600,
        millisecond: 58665600000,
        microsecond: 58665600000000,
        nanosecond: 58665600000000000
    }
*/

All Functions

getYears
getMonths //one month is 30 days
getWeeks
getDays
getHours
getMinutes
getSeconds
getMilliseconds
getMicroseconds
getNanoseconds
getAllInOne //return object

Readme

Keywords

Package Sidebar

Install

npm i dateween

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

4.8 kB

Total Files

4

Last publish

Collaborators

  • sametkoyuncu