friendly-time
v1.1.1
Published
Prints human friendly timestamps (eg. just now, 5 minutes ago, 3 days from now)
Downloads
2,943
Maintainers
Readme
friendly-time
Prints human friendly timestamps (eg. just now, 5 minutes ago, 3 days from now).
Usage
var friendlyTime = require('friendly-time');
var now = new Date();
var minutes = new Date(now - (1000 * 60 * 5));
var days = new Date(now + (1000 * 60 * 60 * 24 * 3));
friendlyTime(now); // just now
friendlyTime(minutes); // 5 minutes ago
friendlyTime(days); // 3 days from now