PrettyTime 1.0.6 Released – New Languages, Thread-Safety
OcpSoft PrettyTime is an open-source time-formatting library for creating human-readable timestamps like, “in 3 minutes,” or “moments ago.” — intuitive, easy, extendable. Visit the home page to download and learn more about using PrettyTime
. New features in this release: Thread Safety, Java 1.5 compatibility, extra languages.
Several new languages are supported out-of-the-box in Version 1.0.6:
In addition to new translations — PrettyTime 1.0.6 is now Thread-Safe (why you would want to share a PrettyTime object is unknown to us, but now you can do it with confidence.)
Java Version 1.5 support:
PrettyFaces had erroneously been “updated” to require Java 1.6; it is now Java 1.5 compliant once more, and can be used on all of your favorite JVMs.
A quick intro to PrettyTime using JUnit:
public class PrettyTimeTest
public void testMinutesFromNow() throws Exception
PrettyTime p = new PrettyTime(new Date(0));
assertEquals("12 minutes from now", p.format(new Date(1000 * 60 * 12)));