public class DateFormat extends Format
http://docs.oracle.com/javase/6/docs/api/java/text/DateFormat.html
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT
Constant for default style (MEDIUM) parsing/formatting pattern.
|
static int |
FULL
Constant for full style parsing/formatting pattern.
|
static int |
LONG
Constant for long style parsing/formatting pattern.
|
static int |
MEDIUM
Constant for medium style parsing/formatting pattern.
|
static int |
SHORT
Constant for short style parsing/formatting pattern.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
String |
format(Date source)
Format a given date.
|
String |
format(Object obj)
Format a given object.
|
static DateFormat |
getDateInstance()
Get a DateFormat instance with default style for date (SHORT).
|
static DateFormat |
getDateInstance(int style)
Get a DateFormat instance that uses a given style for dates.
|
static DateFormat |
getDateTimeInstance(int dateStyle,
int timeStyle)
Get a DateFormat instance that uses a given style for dates and times.
|
static DateFormat |
getInstance()
Get a DateFormat instance with default style for date/time (SHORT/SHORT).
|
static DateFormat |
getTimeInstance()
Get a DateFormat instance with default style for time (SHORT).
|
static DateFormat |
getTimeInstance(int style)
Get a DateFormat instance that uses a given style for times.
|
int |
hashCode()
Returns a hash code value for the object.
|
Date |
parse(String source)
NOT IMPLEMENTED - use SimpleDateFormat for parsing instead.
|
Object |
parseObject(String source)
NOT IMPLEMENTED - use SimpleDateFormat for parsing instead.
|
public static final int FULL
public static final int LONG
public static final int MEDIUM
public static final int SHORT
public static final int DEFAULT
public String format(Object obj) throws IllegalArgumentException
format
in class Format
obj
- object to be formatted to text.IllegalArgumentException
- of the source can not be formatted.public String format(Date source)
source
- date to be formatted.public Object parseObject(String source) throws ParseException
parseObject
in class Format
source
- document to be parsed.ParseException
- if the source could not be parsed.public Date parse(String source) throws ParseException
ParseException
public static final DateFormat getInstance()
public static final DateFormat getDateInstance()
public static final DateFormat getTimeInstance()
public static final DateFormat getDateInstance(int style)
public static final DateFormat getTimeInstance(int style)
public static final DateFormat getDateTimeInstance(int dateStyle, int timeStyle)
public int hashCode()
Object
public boolean equals(Object obj)
Object