abstract class DateFormat extends Format

Purpose

bullet Provides methods for formatting and parsing dates and times and serves as an abstract superclass for date and time formatting.

Field summary

bullet static int AM_PM_FIELD
bullet Represents the AM_PM alignment field.
bullet protected Calendar calendar
bullet Represents the calendar that produces the time field values.
bullet static int DATE_FIELD
bullet Represents the DATE alignment field.
bullet static int DAY_OF_WEEK_FIELD
bullet Represents the DAY_OF_WEEK alignment field.
bullet static int DAY_OF_WEEK_IN_MONTH_FIELD
bullet Represents the DAY_OF_WEEK_IN_MONTH alignment field.
bullet static int DAY_OF_YEAR_FIELD
bullet Represents the DAY_OF_YEAR alignment field.
bullet static int DEFAULT
bullet Represents default style pattern.
bullet static int ERA_FIELD
bullet Represents the ERA alignment field.
bullet static int FULL
bullet Represents full style pattern.
bullet static int HOUR_OF_DAY0_FIELD
bullet Represents the zero-based HOUR_OF_DAY alignment field.
bullet static int HOUR_OF_DAY1_FIELD
bullet Represents the one-based HOUR_OF_DAY alignment field.
bullet static int HOUR0_FIELD
bullet Represents the zero-based HOUR alignment field.
bullet static int HOUR1_FIELD
bullet Represents the one-based HOUR alignment field.
bullet static int LONG Represents long style pattern.
bullet static int MEDIUM Represents medium style pattern.
bullet static int MILLISECOND_FIELD
bullet Represents the MILLISECOND alignment field.
bullet static int MINUTE_FIELD
bullet Represents the MINUTE alignment field.
bullet static int MONTH_FIELD
bullet Represents the MONTH alignment field.
bullet protected NumberFormat numberFormat
bullet Represents the NumberFormat that formats date and time numbers.
bullet static int SECOND_FIELD
bullet Represents the SECOND alignment field.
bullet static int SHORT
bullet Represents short style pattern.
bullet static int TIMEZONE_FIELD
bullet Represents the TIMEZONE alignment field.
bullet static int WEEK_OF_MONTH_FIELD
bullet Represents the WEEK_OF_MONTH alignment field.
bullet static int WEEK_OF_YEAR_FIELD
bullet Represents the WEEK_OF_YEAR alignment field.
bullet static int YEAR_FIELD
bullet Represents the YEAR alignment field.

Class method summary

bullet static Locale[] getAvailableLocales()
bullet Returns an array of possible DateFormat locales.
bullet static DateFormat getDateInstance()
bullet Returns a DateFormat using the default date formatting style for the default locale.
bullet static DateFormat getDateInstance(int d)
bullet Returns a DateFormat using date formatting style d for the default locale.
bullet static DateFormat getDateInstance(int d, Locale l)
bullet Returns a DateFormat using date formatting style d for locale l.
bullet static DateFormat getDateTimeInstance()
bullet Returns a DateFormat using the default date and time formatting style for the default locale.
bullet static DateFormat getDateTimeInstance(int d, int t)
bullet Returns the DateFormat using date formatting style d and time formatting style t for the default locale.
bullet static DateFormat getDateTimeInstance(int d, int t, Locale l)
bullet Returns a DateFormat using date formatting style d and time formatting style t for locale l.
bullet static DateFormat getInstance()
bullet Returns a DateFormat using the date and time SHORT formatting style for the default locale.
bullet static DateFormat getTimeInstance()
bullet Returns a DateFormat using the default time formatting style for the default locale.
bullet static DateFormat getTimeInstance(int t)
bullet Returns a DateFormat using time formatting style t for the default locale.
bullet static DateFormat getTimeInstance(int t, Locale l)
bullet Returns a DateFormat using time formatting style t for locale l.

Constructor summary

bullet protected DateFormat()
bullet Constructs a new date format.

Instance method summary

bullet Object clone()
bullet Returns a new clone of this DateFormat.
bullet boolean equals(Object v)
bullet Returns true if and only if v is an instance of DateFormat representing the same date format value that this object represents.
bullet String format(Date d)
bullet Formats date d into a date and time string using this DateFormat.
bullet abstract StringBuffer format(Date d, StringBuffer s, FieldPosition f)
bullet Returns s after formatting date d into a date and time string into s using this DateFormat. If f indicates a field, then its indices are updated to reflect the position of the field within s
bullet final StringBuffer format(Object d, StringBuffer s, FieldPosition f)
bullet Returns s after formatting date d into a date and time string into s using this DateFormat. If f indicates a field, then its indices are updated to reflect the position of the field within s.
bullet Calendar getCalendar()
bullet Returns the calendar of this DateFormat.
bullet NumberFormat getNumberFormat()
bullet Returns the number formatter of this DateFormat.
bullet TimeZone getTimeZone()
bullet Returns the time zone of this DateFormat.
bullet int hashCode()
bullet Returns the hash code of this DateFormat.
bullet boolean isLenient()
bullet Returns whether this DateFormat parses dates and times leniently (i.e., whether strings need not absolutely follow the date and time specification).
bullet Date parse(String s)
bullet Parses s to produce a date using this DateFormat.
bullet abstract Date parse(String s, ParsePosition i)
bullet Parses s to produce a date using this DateFormat. The parsing starts with the parse position indicated by i. Upon completion of parsing, i reflects the last parsed position.
bullet Object parseObject(String s, ParsePosition i)
bullet Parses s to produce a date using this DateFormat. The parsing starts with the parse position indicated by i. Upon completion of parsing, i reflects the last parsed position.
bullet void setCalendar(Calendar c)
bullet Sets to c the calendar used by this DateFormat.
bullet void setLenient(boolean b)
bullet Sets whether date and time parsing is to be lenient by this DateFormat (i.e., whether strings need not absolutely follow the date and time specification).
bullet void setNumberFormat(NumberFormat n)
bullet Sets to n the number formatter used by this DateFormat.
bullet void setTimeZone(TimeZone t)
bullet Sets to t the time zone for the calendar used by this DateFormat.