| java.lang.Object java.text.Format java.text.DateFormat java.text.SimpleDateFormat
SimpleDateFormat | public class SimpleDateFormat extends DateFormat (Code) | | SimpleDateFormat is used to format and parse Gregorian calendar dates and
times based on a pattern of date and time fields. Each date and time field is
specified in the pattern by a specific character. The characters used can be
either localized or non-localized. For some fields, which have both numeric
and text representations or abbreviated as well as full names, the number of
grouped characters specifies how the field is formatted or parsed.
|
Constructor Summary | |
public | SimpleDateFormat() Constructs a new SimpleDateFormat for formatting and parsing dates and
times in the SHORT style for the default Locale. | public | SimpleDateFormat(String pattern) Constructs a new SimpleDateFormat using the specified non-localized
pattern and the DateFormatSymbols and Calendar for the default Locale. | public | SimpleDateFormat(String template, DateFormatSymbols value) Constructs a new SimpleDateFormat using the specified non-localized
pattern and DateFormatSymbols and the Calendar for the default Locale. | public | SimpleDateFormat(String template, Locale locale) Constructs a new SimpleDateFormat using the specified non-localized
pattern and the DateFormatSymbols and Calendar for the specified Locale. | | SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat) |
Method Summary | |
public void | applyLocalizedPattern(String template) Changes the pattern of this SimpleDateFormat to the specified pattern
which uses localized pattern characters. | public void | applyPattern(String template) Changes the pattern of this SimpleDateFormat to the specified pattern
which uses non-localized pattern characters. | public Object | clone() Answers a new SimpleDateFormat with the same pattern and properties as
this SimpleDateFormat. | public boolean | equals(Object object) Compares the specified object to this SimpleDateFormat and answer if they
are equal. | public StringBuffer | format(Date date, StringBuffer buffer, FieldPosition field) Formats the specified Date into the specified StringBuffer using the
pattern of this SimpleDateFormat. | public AttributedCharacterIterator | formatToCharacterIterator(Object object) Formats the specified object using the rules of this SimpleDateFormat and
returns an AttributedCharacterIterator with the formatted Date and
attributes. | public Date | get2DigitYearStart() Answers the Date which is the start of the one hundred year period for
two digits year values. | public DateFormatSymbols | getDateFormatSymbols() Answers the DateFormatSymbols used by this SimpleDateFormat. | public int | hashCode() Answers an integer hash code for the receiver. | public Date | parse(String string, ParsePosition position) Parse a Date from the specified String starting at the index specified by
the ParsePosition. | public void | set2DigitYearStart(Date date) Sets the Date which is the start of the one hundred year period for two
digits year values. | public void | setDateFormatSymbols(DateFormatSymbols value) Sets the DateFormatSymbols used by this SimpleDateFormat. | public String | toLocalizedPattern() Answers the pattern of this SimpleDateFormat using localized pattern
characters. | public String | toPattern() Answers the pattern of this SimpleDateFormat using non-localized pattern
characters. |
SimpleDateFormat | public SimpleDateFormat()(Code) | | Constructs a new SimpleDateFormat for formatting and parsing dates and
times in the SHORT style for the default Locale.
|
SimpleDateFormat | public SimpleDateFormat(String pattern)(Code) | | Constructs a new SimpleDateFormat using the specified non-localized
pattern and the DateFormatSymbols and Calendar for the default Locale.
Parameters: pattern - the pattern exception: NullPointerException - if a null value of pattern is supplied. exception: IllegalArgumentException - if pattern is not considered to be useableby this formatter. |
SimpleDateFormat | public SimpleDateFormat(String template, DateFormatSymbols value)(Code) | | Constructs a new SimpleDateFormat using the specified non-localized
pattern and DateFormatSymbols and the Calendar for the default Locale.
Parameters: template - the pattern Parameters: value - the DateFormatSymbols exception: NullPointerException - if the pattern is null exception: IllegalArgumentException - if the pattern is invalid |
SimpleDateFormat | public SimpleDateFormat(String template, Locale locale)(Code) | | Constructs a new SimpleDateFormat using the specified non-localized
pattern and the DateFormatSymbols and Calendar for the specified Locale.
Parameters: template - the pattern Parameters: locale - the Locale exception: NullPointerException - if the pattern is null exception: IllegalArgumentException - if the pattern is invalid |
SimpleDateFormat | SimpleDateFormat(Locale locale, com.ibm.icu.text.SimpleDateFormat icuFormat)(Code) | | |
applyLocalizedPattern | public void applyLocalizedPattern(String template)(Code) | | Changes the pattern of this SimpleDateFormat to the specified pattern
which uses localized pattern characters.
Parameters: template - the localized pattern |
applyPattern | public void applyPattern(String template)(Code) | | Changes the pattern of this SimpleDateFormat to the specified pattern
which uses non-localized pattern characters.
Parameters: template - the non-localized pattern exception: NullPointerException - if the pattern is null exception: IllegalArgumentException - if the pattern is invalid |
clone | public Object clone()(Code) | | Answers a new SimpleDateFormat with the same pattern and properties as
this SimpleDateFormat.
a shallow copy of this SimpleDateFormat See Also: java.lang.Cloneable |
equals | public boolean equals(Object object)(Code) | | Compares the specified object to this SimpleDateFormat and answer if they
are equal. The object must be an instance of SimpleDateFormat and have
the same DateFormat properties, pattern, DateFormatSymbols, and creation
year.
Parameters: object - the object to compare with this object true if the specified object is equal to this SimpleDateFormat,false otherwise See Also: SimpleDateFormat.hashCode |
format | public StringBuffer format(Date date, StringBuffer buffer, FieldPosition field)(Code) | | Formats the specified Date into the specified StringBuffer using the
pattern of this SimpleDateFormat. If the field specified by the
FieldPosition is formatted, set the begin and end index of the formatted
field in the FieldPosition.
Parameters: date - the Date to format Parameters: buffer - the StringBuffer Parameters: field - the FieldPosition the StringBuffer parameter buffer exception: IllegalArgumentException - when there are invalid characters in the pattern |
formatToCharacterIterator | public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code) | | Formats the specified object using the rules of this SimpleDateFormat and
returns an AttributedCharacterIterator with the formatted Date and
attributes.
Parameters: object - the object to format an AttributedCharacterIterator with the formatted date andattributes exception: NullPointerException - when the object is null exception: IllegalArgumentException - when the object cannot be formatted by this Format |
get2DigitYearStart | public Date get2DigitYearStart()(Code) | | Answers the Date which is the start of the one hundred year period for
two digits year values.
a Date |
getDateFormatSymbols | public DateFormatSymbols getDateFormatSymbols()(Code) | | Answers the DateFormatSymbols used by this SimpleDateFormat.
a DateFormatSymbols |
hashCode | public int hashCode()(Code) | | Answers an integer hash code for the receiver. Objects which are equal
answer the same value for this method.
the receiver's hash See Also: SimpleDateFormat.equals |
parse | public Date parse(String string, ParsePosition position)(Code) | | Parse a Date from the specified String starting at the index specified by
the ParsePosition. If the string is successfully parsed, the index of the
ParsePosition is updated to the index following the parsed text.
Parameters: string - the String to parse according to the pattern of thisSimpleDateFormat Parameters: position - the ParsePosition, updated on return with the index followingthe parsed text, or on error the index is unchanged and theerror index is set to the index where the error occurred the Date resulting from the parse, or null if there is an error exception: IllegalArgumentException - when there are invalid characters in the pattern |
set2DigitYearStart | public void set2DigitYearStart(Date date)(Code) | | Sets the Date which is the start of the one hundred year period for two
digits year values.
Parameters: date - the Date |
setDateFormatSymbols | public void setDateFormatSymbols(DateFormatSymbols value)(Code) | | Sets the DateFormatSymbols used by this SimpleDateFormat.
Parameters: value - the DateFormatSymbols |
toLocalizedPattern | public String toLocalizedPattern()(Code) | | Answers the pattern of this SimpleDateFormat using localized pattern
characters.
the localized pattern |
toPattern | public String toPattern()(Code) | | Answers the pattern of this SimpleDateFormat using non-localized pattern
characters.
the non-localized pattern |
Methods inherited from java.text.DateFormat | public Object clone()(Code)(Java Doc) public boolean equals(Object object)(Code)(Java Doc) final public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc) final public String format(Date date)(Code)(Java Doc) abstract public StringBuffer format(Date date, StringBuffer buffer, FieldPosition field)(Code)(Java Doc) public static Locale[] getAvailableLocales()(Code)(Java Doc) public Calendar getCalendar()(Code)(Java Doc) final public static DateFormat getDateInstance()(Code)(Java Doc) final public static DateFormat getDateInstance(int style)(Code)(Java Doc) final public static DateFormat getDateInstance(int style, Locale locale)(Code)(Java Doc) final public static DateFormat getDateTimeInstance()(Code)(Java Doc) final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle)(Code)(Java Doc) final public static DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale)(Code)(Java Doc) final public static DateFormat getInstance()(Code)(Java Doc) public NumberFormat getNumberFormat()(Code)(Java Doc) static String getStyleName(int style)(Code)(Java Doc) final public static DateFormat getTimeInstance()(Code)(Java Doc) final public static DateFormat getTimeInstance(int style)(Code)(Java Doc) final public static DateFormat getTimeInstance(int style, Locale locale)(Code)(Java Doc) public TimeZone getTimeZone()(Code)(Java Doc) public int hashCode()(Code)(Java Doc) public boolean isLenient()(Code)(Java Doc) public Date parse(String string) throws ParseException(Code)(Java Doc) abstract public Date parse(String string, ParsePosition position)(Code)(Java Doc) public Object parseObject(String string, ParsePosition position)(Code)(Java Doc) public void setCalendar(Calendar cal)(Code)(Java Doc) public void setLenient(boolean value)(Code)(Java Doc) public void setNumberFormat(NumberFormat format)(Code)(Java Doc) public void setTimeZone(TimeZone timezone)(Code)(Java Doc)
|
Methods inherited from java.text.Format | public Object clone()(Code)(Java Doc) String convertPattern(String template, String fromChars, String toChars, boolean check)(Code)(Java Doc) final public String format(Object object)(Code)(Java Doc) abstract public StringBuffer format(Object object, StringBuffer buffer, FieldPosition field)(Code)(Java Doc) public AttributedCharacterIterator formatToCharacterIterator(Object object)(Code)(Java Doc) static Object getInternalField(String fieldName, Object target)(Code)(Java Doc) public Object parseObject(String string) throws ParseException(Code)(Java Doc) abstract public Object parseObject(String string, ParsePosition position)(Code)(Java Doc) static boolean upTo(String string, ParsePosition position, StringBuffer buffer, char stop)(Code)(Java Doc) static boolean upToWithQuotes(String string, ParsePosition position, StringBuffer buffer, char stop, char start)(Code)(Java Doc)
|
|
|