Class SimpleDateFormat
java.lang.Object
java.text.Format
java.text.DateFormat
java.text.SimpleDateFormat
- All Implemented Interfaces:
Cloneable
A class for parsing and formatting dates with a given pattern, compatible
with the Java 6 API.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a SimpleDateFormat with no pattern.SimpleDateFormat(String pattern) Construct a SimpleDateFormat with a given pattern. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPattern(String pattern) Apply a new pattern.clone()Format a given date.Get the date format symbols for parsing/formatting textual components of dates in a localization sensitive way.NOT IMPLEMENTED - use SimpleDateFormat for parsing instead.voidsetDateFormatSymbols(DateFormatSymbols newSymbols) Apply new date format symbols for parsing/formatting textual components of dates in a localisation sensitive way.Returns
Methods inherited from class DateFormat
equals, format, getDateInstance, getDateInstance, getDateTimeInstance, getInstance, getTimeInstance, getTimeInstance, hashCode, parseObject
-
Constructor Details
-
SimpleDateFormat
public SimpleDateFormat()Construct a SimpleDateFormat with no pattern. -
SimpleDateFormat
Construct a SimpleDateFormat with a given pattern.
Parameters
pattern
-
-
Method Details
-
toPattern
Returns
the pattern
-
getDateFormatSymbols
Get the date format symbols for parsing/formatting textual components of dates in a localization sensitive way.
Returns
current symbols.
-
setDateFormatSymbols
Apply new date format symbols for parsing/formatting textual components of dates in a localisation sensitive way.
Parameters
newSymbols: new format symbols.
-
applyPattern
Apply a new pattern.
Parameters
pattern: the pattern to set
-
clone
- Overrides:
clonein classDateFormat
-
format
Description copied from class:DateFormatFormat a given date.
Parameters
source: date to be formatted.
Returns
formatted date.
- Overrides:
formatin classDateFormat
-
parse
Description copied from class:DateFormatNOT IMPLEMENTED - use SimpleDateFormat for parsing instead.- Overrides:
parsein classDateFormat- Throws:
ParseException
-