public class SimpleDateFormat extends DateFormat
Constructor and Description |
---|
SimpleDateFormat()
Construct a SimpleDateFormat with no pattern.
|
SimpleDateFormat(String pattern)
Construct a SimpleDateFormat with a given pattern.
|
Modifier and Type | Method and Description |
---|---|
void |
applyPattern(String pattern)
Apply a new pattern.
|
Object |
clone() |
String |
format(Date source)
Format a given date.
|
DateFormatSymbols |
getDateFormatSymbols()
Get the date format symbols for parsing/formatting textual components of
dates in a localization sensitive way.
|
Date |
parse(String source)
Parses text from a string to produce a Date.
|
void |
setDateFormatSymbols(DateFormatSymbols newSymbols)
Apply new date format symbols for parsing/formatting textual components
of dates in a localisation sensitive way.
|
String |
toPattern() |
equals, format, getDateInstance, getDateInstance, getDateTimeInstance, getInstance, getTimeInstance, getTimeInstance, hashCode, parseObject
public SimpleDateFormat()
public SimpleDateFormat(String pattern)
pattern
- public String toPattern()
public DateFormatSymbols getDateFormatSymbols()
public void setDateFormatSymbols(DateFormatSymbols newSymbols)
newSymbols
- new format symbols.public void applyPattern(String pattern)
pattern
- the pattern to setpublic Object clone()
clone
in class DateFormat
public String format(Date source)
DateFormat
format
in class DateFormat
source
- date to be formatted.public Date parse(String source) throws ParseException
parse
in class DateFormat
ParseException