/seiko

A collection of tools for JavaScript dates

Primary LanguageTypeScriptMIT LicenseMIT

🗓⏱ seiko NPM version NPM monthly downloads NPM total downloads

A collection of Date and time related tools.

Install

Install with npm:

$ npm install --save seiko

Usage

DateDelta

const seiko = require('seiko');

const date1 = new Date('07/16/1998.12:00:01');
const date2 = new Date('07/16/1998.12:00:00');

const delta = seiko.dateDelta(date1, date2, { timeFormat: 'milliseconds' });
console.log(delta); //=> 1000

const seiko = require('seiko');

console.log(seiko.convertTime(1000, 'seconds')); //=> 1