Registry / utility / prettytime

prettytime

JSON →
library2.1.0javamavenunverified

Provides social-style time formatting utilities for displaying relative time in a human-readable format.

<dependency> <groupId>org.ocpsoft.prettytime</groupId> <artifactId>prettytime</artifactId> <version>2.1.0</version> </dependency>
INSTALL
IMPORT
SIG · PRETTYTIME
P
prettytime
utilityjavav2.1.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrettyTime
org.ocpsoft.prettytime.PrettyTime

Formats a date as a relative time string.

import org.ocpsoft.prettytime.PrettyTime; PrettyTime p = new PrettyTime(); System.out.println(p.format(new Date(System.currentTimeMillis() - 60000))); // "1 minute ago"
Debug
Known issues
breakingPrettyTime 2.x uses Java 8 time API (java.time) by default, which may break code using java.util.Date.
fix
Use PrettyTime(Locale) constructor with java.util.Date or migrate to java.time.Instant.
affects: >=2.0.0
Upgrade
Version history
2.1.0latest on Maven
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
prettytime — mvn dependency:get prettytime · libregistry