public class DateTool
extends java.lang.Object
DateFormat instance to provide thread safety.| Modifier and Type | Field and Description |
|---|---|
private java.text.DateFormat |
df |
protected static java.lang.String |
FORMAT |
| Constructor and Description |
|---|
DateTool()
Uses the
DateFormat string
yyyyMMdd'T'HH:mm:ss. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(java.util.Date d) |
java.util.Date |
parse(java.lang.String s) |
void |
setTimeZone(java.util.TimeZone z) |
protected static final java.lang.String FORMAT
private java.text.DateFormat df
public DateTool()
DateFormat string
yyyyMMdd'T'HH:mm:ss.FORMATpublic java.lang.String format(java.util.Date d)
d - The date to format.public void setTimeZone(java.util.TimeZone z)
public java.util.Date parse(java.lang.String s)
throws java.text.ParseException
s - The text to parse a date from.java.text.ParseException - If the date could not be parsed.Copyright ? 1999-2002 Apache Software Foundation. All Rights Reserved.