java.text
public class SimpleDateFormat extends DateFormat
Constructor Summary | |
---|---|
SimpleDateFormat()
Constructs a SimpleDateFormat using the default pattern for
the default locale. | |
SimpleDateFormat(String pattern)
Creates a date formatter using the specified non-localized pattern,
with the default DateFormatSymbols for the default locale.
| |
SimpleDateFormat(String pattern, Locale locale)
Creates a date formatter using the specified non-localized pattern,
with the default DateFormatSymbols for the given locale.
| |
SimpleDateFormat(String pattern, DateFormatSymbols formatData)
Creates a date formatter using the specified non-localized
pattern. |
Method Summary | |
---|---|
void | applyLocalizedPattern(String pattern)
This method sets the formatting pattern that should be used by this
object. |
void | applyPattern(String pattern)
This method sets the formatting pattern that should be used by this
object. |
Object | clone()
Returns a copy of this instance of
SimpleDateFormat . |
boolean | equals(Object o)
This methods tests whether the specified object is equal to this
object. |
StringBuffer | format(Date date, StringBuffer buffer, FieldPosition pos) |
AttributedCharacterIterator | formatToCharacterIterator(Object date) |
Date | get2DigitYearStart()
Returns the start of the century used for two digit years.
|
DateFormatSymbols | getDateFormatSymbols()
This method returns a copy of the format symbol information used
for parsing and formatting dates.
|
int | hashCode()
This method returns a hash value for this object.
|
Date | parse(String dateStr, ParsePosition pos)
This method parses the specified string into a date.
|
void | set2DigitYearStart(Date date)
Sets the start of the century used for two digit years.
|
void | setDateFormatSymbols(DateFormatSymbols formatData)
This method sets the format symbols information used for parsing
and formatting dates.
|
String | toLocalizedPattern()
This method returns a string with the formatting pattern being used
by this object. |
String | toPattern()
This method returns a string with the formatting pattern being used
by this object. |
String | toString()
Returns a string representation of this
class.
|
Parameters: pattern the pattern to use.
Throws: NullPointerException if the pattern is null. IllegalArgumentException if the pattern is invalid.
Parameters: pattern the non-localized pattern to use. locale the locale to use for the formatting symbols.
Throws: NullPointerException if the pattern is null. IllegalArgumentException if the pattern is invalid.
Parameters: pattern the non-localized pattern to use. formatData the formatting symbols to use.
Throws: NullPointerException if the pattern or formatData is null. IllegalArgumentException if the pattern is invalid.
Parameters: pattern The new format pattern.
Throws: NullPointerException if the pattern is null. IllegalArgumentException if the pattern is invalid.
Parameters: pattern The new format pattern.
Throws: NullPointerException if the pattern is null. IllegalArgumentException if the pattern is invalid.
SimpleDateFormat
. The copy contains
clones of the formatting symbols and the 2-digit
year century start date.
null
.SimpleDateFormat
.DateFormat
)
level.Parameters: o The object to compare for equality against.
Returns: true
if the specified object is equal to this object,
false
otherwise.
Returns: A Date
representing the start of the century
for two digit years.
Returns: a copy of the date format symbols.
Returns: A hash value for this object.
Parameters: dateStr The date string to parse. pos The input and output parse position
Returns: The parsed date, or null
if the string cannot be
parsed.
Parameters: date A Date
representing the start of the century for
two digit years.
Parameters: formatData The date format symbols.
Throws: NullPointerException if formatData
is null.
Returns: The format string.
Returns: The format string.
Returns: a string representation of the SimpleDateFormat
instance.