Need private packages and team management tools?Check out npm Teams »

s-age

1.1.2 • Public • Published

s-age

NPM version Dependencies build status NPM license

Usage

s-age is a function that calculates years since a date. Input can be a date string, timestamp, or Date object.

var age = require('s-age');
 
age('2012'); // returns 6 (in 2018)
age('Dec 2 2012'); // returns 5 (in January 2018)
age(new Date()); // returns 0
age(1356728100000); // returns 5 (in 2018)

Install

npm i s-age

DownloadsWeekly Downloads

1,356

Version

1.1.2

License

MIT

Last publish

Collaborators

  • avatar