Class PrettyTime

java.lang.Object
org.ocpsoft.prettytime.PrettyTime

public class PrettyTime extends Object
A utility for creating social-networking style timestamps. (e.g. "just now", "moments ago", "3 days ago", "within 2 months")

Usage:

PrettyTime t = new PrettyTime();
String timestamp = t.format(new Date());
//result: moments from now

String timestamp = t.format(new Date(System.currentTimeMillis() + 1000 * 60 * 10));
//result: 10 minutes from now

Author:
Lincoln Baxter, III