@Immutable public class

DateTimeVelocityUtils

extends Object
java.lang.Object
   ↳ com.atlassian.jira.datetime.DateTimeVelocityUtils

Class Overview

Aggregates the most commonly-used date/time formats in a single instance, for use within Velocity templates. All strings returned by this class are in the user's time zone, and are either HTML- or XML-escaped (as appropriate).

Summary

Public Constructors
DateTimeVelocityUtils(DateTimeFormatter dateTimeFormatter)
Creates a new DateTimeFormats instance that will format date/time instances in the time zone of the passed-in DateTimeFormatter.
Public Methods
String formatDMY(Date date)
Returns a string representation of the given date/time in DateTimeStyle#DATE format.
String formatDMYHMS(Date date)
Returns a string representation of the given date/time in DateTimeStyle#COMPLETE format.
String formatRSS(Date date)
Returns a string representation of the given date/time in DateTimeStyle#RSS_RFC822_DATE_TIME format.
String formatTime(Date date)
Returns a string representation of the given date/time in DateTimeStyle#TIME format.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public DateTimeVelocityUtils (DateTimeFormatter dateTimeFormatter)

Creates a new DateTimeFormats instance that will format date/time instances in the time zone of the passed-in DateTimeFormatter.

Parameters
dateTimeFormatter a DateTimeFormatter

Public Methods

public String formatDMY (Date date)

Returns a string representation of the given date/time in DateTimeStyle#DATE format.

Parameters
date a date/time to format
Returns
  • an string containing the given date/time (HTML-escaped)

public String formatDMYHMS (Date date)

Returns a string representation of the given date/time in DateTimeStyle#COMPLETE format.

Parameters
date a date/time to format
Returns
  • an string containing the given date/time (HTML-escaped)

public String formatRSS (Date date)

Returns a string representation of the given date/time in DateTimeStyle#RSS_RFC822_DATE_TIME format.

Parameters
date a date/time to format
Returns
  • an string containing the given date/time (XML-escaped)

public String formatTime (Date date)

Returns a string representation of the given date/time in DateTimeStyle#TIME format.

Parameters
date a date/time to format
Returns
  • an string containing the given date/time (HTML-escaped)