0.0.2 • Published 7 years ago

milli-epoch v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

milli-epoch

Utility module for epoch based time functions in milliseconds

Build Status

Installation

$ npm install milli-epoch

Simple Usage

code example:

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