org.apache.commons.lang.time
public class DateFormatUtils extends Object
Date and time formatting utilities and constants.
Formatting is performed using the {@link org.apache.commons.lang.time.FastDateFormat} class.
Since: 2.0
Version: $Id: DateFormatUtils.java 161243 2005-04-14 04:30:28Z ggregory $
Field Summary | |
---|---|
static FastDateFormat | ISO_DATETIME_FORMAT
ISO8601 formatter for date-time without time zone.
|
static FastDateFormat | ISO_DATETIME_TIME_ZONE_FORMAT
ISO8601 formatter for date-time with time zone.
|
static FastDateFormat | ISO_DATE_FORMAT
ISO8601 formatter for date without time zone.
|
static FastDateFormat | ISO_DATE_TIME_ZONE_FORMAT
ISO8601-like formatter for date with time zone.
|
static FastDateFormat | ISO_TIME_FORMAT
ISO8601 formatter for time without time zone.
|
static FastDateFormat | ISO_TIME_NO_T_FORMAT
ISO8601-like formatter for time without time zone.
|
static FastDateFormat | ISO_TIME_NO_T_TIME_ZONE_FORMAT
ISO8601-like formatter for time with time zone.
|
static FastDateFormat | ISO_TIME_TIME_ZONE_FORMAT
ISO8601 formatter for time with time zone.
|
static FastDateFormat | SMTP_DATETIME_FORMAT
SMTP (and probably other) date headers.
|
Constructor Summary | |
---|---|
DateFormatUtils() DateFormatUtils instances should NOT be constructed in standard programming. This constructor is public to permit tools that require a JavaBean instance to operate. |
Method Summary | |
---|---|
static String | format(long millis, String pattern) Format a date/time into a specific pattern. |
static String | format(Date date, String pattern) Format a date/time into a specific pattern. |
static String | format(long millis, String pattern, TimeZone timeZone) Format a date/time into a specific pattern in a time zone. |
static String | format(Date date, String pattern, TimeZone timeZone) Format a date/time into a specific pattern in a time zone. |
static String | format(long millis, String pattern, Locale locale) Format a date/time into a specific pattern in a locale. |
static String | format(Date date, String pattern, Locale locale) Format a date/time into a specific pattern in a locale. |
static String | format(long millis, String pattern, TimeZone timeZone, Locale locale) Format a date/time into a specific pattern in a time zone and locale. |
static String | format(Date date, String pattern, TimeZone timeZone, Locale locale) Format a date/time into a specific pattern in a time zone and locale. |
static String | formatUTC(long millis, String pattern) Format a date/time into a specific pattern using the UTC time zone. |
static String | formatUTC(Date date, String pattern) Format a date/time into a specific pattern using the UTC time zone. |
static String | formatUTC(long millis, String pattern, Locale locale) Format a date/time into a specific pattern using the UTC time zone. |
static String | formatUTC(Date date, String pattern, Locale locale) Format a date/time into a specific pattern using the UTC time zone. |
DateFormatUtils instances should NOT be constructed in standard programming.
This constructor is public to permit tools that require a JavaBean instance to operate.
Format a date/time into a specific pattern.
Parameters: millis the date to format expressed in milliseconds pattern the pattern to use to format the date
Returns: the formatted date
Format a date/time into a specific pattern.
Parameters: date the date to format pattern the pattern to use to format the date
Returns: the formatted date
Format a date/time into a specific pattern in a time zone.
Parameters: millis the time expressed in milliseconds pattern the pattern to use to format the date timeZone the time zone to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern in a time zone.
Parameters: date the date to format pattern the pattern to use to format the date timeZone the time zone to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern in a locale.
Parameters: millis the date to format expressed in milliseconds pattern the pattern to use to format the date locale the locale to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern in a locale.
Parameters: date the date to format pattern the pattern to use to format the date locale the locale to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern in a time zone and locale.
Parameters: millis the date to format expressed in milliseconds pattern the pattern to use to format the date timeZone the time zone to use, may be null
locale the locale to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern in a time zone and locale.
Parameters: date the date to format pattern the pattern to use to format the date timeZone the time zone to use, may be null
locale the locale to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern using the UTC time zone.
Parameters: millis the date to format expressed in milliseconds pattern the pattern to use to format the date
Returns: the formatted date
Format a date/time into a specific pattern using the UTC time zone.
Parameters: date the date to format pattern the pattern to use to format the date
Returns: the formatted date
Format a date/time into a specific pattern using the UTC time zone.
Parameters: millis the date to format expressed in milliseconds pattern the pattern to use to format the date locale the locale to use, may be null
Returns: the formatted date
Format a date/time into a specific pattern using the UTC time zone.
Parameters: date the date to format pattern the pattern to use to format the date locale the locale to use, may be null
Returns: the formatted date