Use PrettyTime JSTL tags in JSP
masterTo use PrettyTime for human-readable date formatting in a JSP file, declare the tag library and then use the <ocpsoft:prettytime> tag.
1. Declare the tag library:
Add the following directive to the top of your JSP file:
<%@ taglib prefix="ocpsoft" uri="http://ocpsoft.org/prettytime/tags" %>
2. Use the tag:
Pass a date object to the date parameter. You can optionally specify a locale to localize the output.
<ocpsoft:prettytime date="${myDate}" locale="en_US"/><%@ taglib prefix="ocpsoft" uri="http://ocpsoft.org/prettytime/tags" %>
<ocpsoft:prettytime date="${myDate}" locale="en_US"/>