Plugins You can find out about all the publicly available Grails plugins.

Pretty-time plugin

12 votes
compile "org.grails.plugins:pretty-time:2.1.3.Final-1.0.1"

 Documentation  Source  Issues


A plugin that allows you to display human readable, relative timestamps.


grails install-plugin pretty-time



  • Grails 2.0 or above
  • for Grails 1.x use version 0.3


<prettytime:display date="${someDate}" />


"right now", "2 days ago", or "3 months from now"

Internationalization (I18n)

Build in - uses prettytime library translations. TagLib included in this plugin respects current locale.

Tag attributes

dateThe date object to format.
capitalizeCapitalize the output text (default: false). Ex: "moments ago" -> "Moments ago".
showTimeShow the time (default: false). Ex: "2 days ago, 12:00:25 AM".
formatThe format to use for the date (default: "hh:mm:ss a"). The default value is set by "" in I18n.

Version History

  • 2.1.3.Final-1.0.1 - Small fix to "legacyResolve" which was introduced in Grails 2.1.3
  • 2.1.3.Final-1.0 - Refactored. Updated pretty-time library to latest version of the lib (2.1.3). @Janusz Slota: many thanks for your contribution!
  • 0.3 - Upgraded pretty-time library and added 2 tag attributes: "showTime" and "format".
  • 0.2.1 - Fixed blank spaces.
  • 0.2 - Added support for DateTime class of Joda-Time; added "capitalize" tag attribute.
  • 0.1 - First official release.

Suggestions, comments or bugs

Feel free to submit questions or comments to the Grails users mailing list. Alternatively you can contact me directly - cazacugmihai at gmail dot com

Please report any issues to the Grails users mailing list and/or write up an issue in JIRA.