Class DateVelocityUtils

java.lang.Object
com.atlassian.jira.datetime.DateVelocityUtils

@Immutable public class DateVelocityUtils extends Object
Aggregates the most commonly-used date formats in a single instance, for use within Velocity templates. All strings returned by this class are in the system time zone, and are either HTML- or XML-escaped (as appropriate).
Since:
v5.0
  • Constructor Details

  • Method Details

    • formatRelative

      public String formatRelative(Date date)
      Returns a string representation of the given date in DateTimeStyle#RELATIVE_WITHOUT_TIME format.
      Parameters:
      date - a date/time to format
      Returns:
      an string containing the given date/time (HTML-escaped)
    • formatRSS

      public String formatRSS(Date date)
      Returns a string representation of the given date in DateTimeStyle#RSS_RFC822_DATE_TIME format.
      Parameters:
      date - a date/time to format
      Returns:
      an string containing the given date/time (XML-escaped)