Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.commons.lang.time
Class DateFormatUtils  view DateFormatUtils download DateFormatUtils.java

java.lang.Object
  extended byorg.apache.commons.lang.time.DateFormatUtils

public class DateFormatUtils
extends java.lang.Object

Date and time formatting utilities and constants.

Formatting is performed using the FastDateFormat class.

Since:
2.0
Version:
$Id: DateFormatUtils.java 161243 2005-04-14 04:30:28Z ggregory $

Field Summary
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_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_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.
 
Method Summary
static java.lang.String format(java.util.Date date, java.lang.String pattern)
          Format a date/time into a specific pattern.
static java.lang.String format(java.util.Date date, java.lang.String pattern, java.util.Locale locale)
          Format a date/time into a specific pattern in a locale.
static java.lang.String format(java.util.Date date, java.lang.String pattern, java.util.TimeZone timeZone)
          Format a date/time into a specific pattern in a time zone.
static java.lang.String format(java.util.Date date, java.lang.String pattern, java.util.TimeZone timeZone, java.util.Locale locale)
          Format a date/time into a specific pattern in a time zone and locale.
static java.lang.String format(long millis, java.lang.String pattern)
          Format a date/time into a specific pattern.
static java.lang.String format(long millis, java.lang.String pattern, java.util.Locale locale)
          Format a date/time into a specific pattern in a locale.
static java.lang.String format(long millis, java.lang.String pattern, java.util.TimeZone timeZone)
          Format a date/time into a specific pattern in a time zone.
static java.lang.String format(long millis, java.lang.String pattern, java.util.TimeZone timeZone, java.util.Locale locale)
          Format a date/time into a specific pattern in a time zone and locale.
static java.lang.String formatUTC(java.util.Date date, java.lang.String pattern)
          Format a date/time into a specific pattern using the UTC time zone.
static java.lang.String formatUTC(java.util.Date date, java.lang.String pattern, java.util.Locale locale)
          Format a date/time into a specific pattern using the UTC time zone.
static java.lang.String formatUTC(long millis, java.lang.String pattern)
          Format a date/time into a specific pattern using the UTC time zone.
static java.lang.String formatUTC(long millis, java.lang.String pattern, java.util.Locale locale)
          Format a date/time into a specific pattern using the UTC time zone.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISO_DATETIME_FORMAT

public static final FastDateFormat ISO_DATETIME_FORMAT
ISO8601 formatter for date-time without time zone. The format used is yyyy-MM-dd'T'HH:mm:ss.


ISO_DATETIME_TIME_ZONE_FORMAT

public static final FastDateFormat ISO_DATETIME_TIME_ZONE_FORMAT
ISO8601 formatter for date-time with time zone. The format used is yyyy-MM-dd'T'HH:mm:ssZZ.


ISO_DATE_FORMAT

public static final FastDateFormat ISO_DATE_FORMAT
ISO8601 formatter for date without time zone. The format used is yyyy-MM-dd.


ISO_DATE_TIME_ZONE_FORMAT

public static final FastDateFormat ISO_DATE_TIME_ZONE_FORMAT
ISO8601-like formatter for date with time zone. The format used is yyyy-MM-ddZZ. This pattern does not comply with the formal ISO8601 specification as the standard does not allow a time zone without a time.


ISO_TIME_FORMAT

public static final FastDateFormat ISO_TIME_FORMAT
ISO8601 formatter for time without time zone. The format used is 'T'HH:mm:ss.


ISO_TIME_TIME_ZONE_FORMAT

public static final FastDateFormat ISO_TIME_TIME_ZONE_FORMAT
ISO8601 formatter for time with time zone. The format used is 'T'HH:mm:ssZZ.


ISO_TIME_NO_T_FORMAT

public static final FastDateFormat ISO_TIME_NO_T_FORMAT
ISO8601-like formatter for time without time zone. The format used is HH:mm:ss. This pattern does not comply with the formal ISO8601 specification as the standard requires the 'T' prefix for times.


ISO_TIME_NO_T_TIME_ZONE_FORMAT

public static final FastDateFormat ISO_TIME_NO_T_TIME_ZONE_FORMAT
ISO8601-like formatter for time with time zone. The format used is HH:mm:ssZZ. This pattern does not comply with the formal ISO8601 specification as the standard requires the 'T' prefix for times.


SMTP_DATETIME_FORMAT

public static final FastDateFormat SMTP_DATETIME_FORMAT
SMTP (and probably other) date headers. The format used is EEE, dd MMM yyyy HH:mm:ss Z in US locale.

Constructor Detail

DateFormatUtils

public 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 Detail

formatUTC

public static java.lang.String formatUTC(long millis,
                                         java.lang.String pattern)

Format a date/time into a specific pattern using the UTC time zone.


formatUTC

public static java.lang.String formatUTC(java.util.Date date,
                                         java.lang.String pattern)

Format a date/time into a specific pattern using the UTC time zone.


formatUTC

public static java.lang.String formatUTC(long millis,
                                         java.lang.String pattern,
                                         java.util.Locale locale)

Format a date/time into a specific pattern using the UTC time zone.


formatUTC

public static java.lang.String formatUTC(java.util.Date date,
                                         java.lang.String pattern,
                                         java.util.Locale locale)

Format a date/time into a specific pattern using the UTC time zone.


format

public static java.lang.String format(long millis,
                                      java.lang.String pattern)

Format a date/time into a specific pattern.


format

public static java.lang.String format(java.util.Date date,
                                      java.lang.String pattern)

Format a date/time into a specific pattern.


format

public static java.lang.String format(long millis,
                                      java.lang.String pattern,
                                      java.util.TimeZone timeZone)

Format a date/time into a specific pattern in a time zone.


format

public static java.lang.String format(java.util.Date date,
                                      java.lang.String pattern,
                                      java.util.TimeZone timeZone)

Format a date/time into a specific pattern in a time zone.


format

public static java.lang.String format(long millis,
                                      java.lang.String pattern,
                                      java.util.Locale locale)

Format a date/time into a specific pattern in a locale.


format

public static java.lang.String format(java.util.Date date,
                                      java.lang.String pattern,
                                      java.util.Locale locale)

Format a date/time into a specific pattern in a locale.


format

public static java.lang.String format(long millis,
                                      java.lang.String pattern,
                                      java.util.TimeZone timeZone,
                                      java.util.Locale locale)

Format a date/time into a specific pattern in a time zone and locale.


format

public static java.lang.String format(java.util.Date date,
                                      java.lang.String pattern,
                                      java.util.TimeZone timeZone,
                                      java.util.Locale locale)

Format a date/time into a specific pattern in a time zone and locale.