Get a string representation of a time difference
npm install epoch-to-timeagoepoch-to-timeago  
================
> Get a string representation of a time difference
```
$ npm install --save epoch-to-timeago
`js
var timeAgo = require('epoch-to-timeago').timeAgo
var originalTime = new Date().getTime()
var oneSecond = originalTime + 1000
var twoMinutes = originalTime + (2000 * 60)
timeAgo(originalTime, oneSecond) // 1 second ago
timeAgo(originalTime, twoMinutes) // 2 minutes ago
`
Don't like the default cutoffs? Replace them with your own!
`js
var convert = require('epoch-to-timeago')
convert.cutoff.seconds = 63
timeAgo(originalTime, sixtyOneSeconds) // 61 seconds ago
timeAgo(originalTime, sixtyFourSeconds) // 1 minute ago
`
Don't like the default suffixes? Replace them with your own!
`js
var convert = require('epoch-to-timeago')
convert.suffixDictionary = require('./german-suffix')
var timeAgo = convert.timeAgo
timeAgo(originalTime, oneSecond) // 1 zweite vor
timeAgo(originalTime, twoSeconds) // 2 vor sekundan
`
Don't like the default time calculations? Replace them with your own!
`js``
var convert = require('epoch-to-timeago')
convert.timeCalcs.months = function (pastEpoch, currentEpoch) {
// 30 day month instead of 31
return (currentEpoch - pastEpoch) / 1000 / 60 / 60 / 24 / 30
}
var timeAgo = convert.timeAgo
MIT