milli-epoch

Utility module for epoch based time functions in milliseconds

npm install milli-epoch
2 downloads in the last week
4 downloads in the last month

milli-epoch

Utility module for epoch based time functions in milliseconds

Build Status

Installation

$ npm install milli-epoch

Simple Usage

code:

var milli-epoch = require('milli-epoch');

var now = milli-epoch.now();
var then = milli-epoch.addMinutes(5);
var date = new Date(then);

console.log('now in milli-epoch ' + now + ' and 5 minutes from now is ' + then);
console.log('which is ' + date.toString());

Functions

  • now
  • addMinutes
  • addSeconds
  • addDays
  • subtractDays
  • subtractMinutes
  • addYears
  • isInFuture
  • isInPast
  • getMillisecondsSince
  • getSecondsSince
  • getMinutesSince
  • getHoursSince
  • getDaysSince
  • getYearsSince
  • getMinDate
  • getMaxDate
  • fromEpoch
  • toEpoch
  • getEpochBeforeMinutes
npm loves you