|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.rapla.components.util.SerializableDateTimeFormat
public class SerializableDateTimeFormat
Provides methods for parsing and formating dates
and times in the following format:
2002-25-05
for dates and 13:00:00
for times.
This is according to the xschema specification for dates and time.
WARNING: Do not share instances of this class between threads. Its NOT thread safe
Constructor Summary | |
---|---|
SerializableDateTimeFormat()
|
|
SerializableDateTimeFormat(Calendar calendar)
|
Method Summary | |
---|---|
String |
formatDate(Date date)
same as formatDate(date, false). |
String |
formatDate(Date date,
boolean adaptDay)
returns the date object in the following format: 2001-10-21. |
String |
formatTime(Date date)
returns the time object in the following format: 13:00:00. |
Date |
parseDate(String date,
boolean fillDate)
The date-string must be in the following format 2001-10-21. |
Date |
parseDateTime(String date,
String time)
The date-string must be in the following format 2001-10-21. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SerializableDateTimeFormat()
public SerializableDateTimeFormat(Calendar calendar)
Method Detail |
---|
public Date parseDateTime(String date, String time) throws ParseException
ParseException
- when the date cannot be parsed.public Date parseDate(String date, boolean fillDate) throws ParseException
fillDate
- if this flag is set the time will be 24:00 instead of 0:00
When this flag is set the time parameter should be null
ParseException
- when the date cannot be parsed.public String formatTime(Date date)
public String formatDate(Date date, boolean adaptDay)
adaptDay
- if the flag is set 2001-10-21 will be stored as 2001-10-20.
This is usefull for end-dates: 2001-10-21 00:00 is then interpreted as
2001-10-20 24:00.public String formatDate(Date date)
formatDate(Date,boolean)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |