1.2.1 • Published 11 years ago

time_ago_in_words v1.2.1

Weekly downloads
32
License
-
Repository
github
Last release
11 years ago

time_ago_in_words

A simple function that takes a timestamp and returns the time period between then and now in words (eg: '15 minutes ago')

Usage

Simply pass a timestamp into the time_ago_in_words function like so:

time_ago_in_words(new Date() - (1000 60 60))

and it will return the time period. The example above will return '1 hour ago'

NodeJS

This script is compatible with NodeJS. To use it, you can install the package from NPM: npm install time_ago_in_words then use it like so:

var time_ago_in_words = require('./time_ago_in_words');

console.log(time_ago_in_words(new Date() - 1000 * 60));

1.2.1

11 years ago

1.1.0

11 years ago

1.0.2

11 years ago

1.0.0

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago