New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

date-minus

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-minus

Date minus by pure javascript

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
9
350%
Maintainers
1
Weekly downloads
 
Created
Source

date-minus

Date minus by pure javascript.

Usage

call the function

const dateMinus = require('./').dateMinus;
var preDate = (new Date()).setFullYear(2009);
var howlong = dateMinus(preDate);

output

{
  "years": 8,
  "months": 0,
  "days": 0,
  "hours": "00",
  "minutes": "00",
  "seconds": "00",
  "passed": true, // date相对current为过去时间(date is earlier than current.)
  "date": "2009-09-22T15:52:28.861Z",
  "current": "2017-09-22T15:52:28.862Z"
}

Parmeters

input

参数名类型默认值备注
dateDate/Number当前时间减数
currentDate/Number当前时间被减数

Keywords

date

FAQs

Package last updated on 22 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts