milli-epoch
v0.0.2
Published
Utility module for epoch based time functions in milliseconds
Downloads
11
Maintainers
Readme
milli-epoch
Utility module for epoch based time functions in milliseconds
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