org.apache.xmlrpc.util
Class DateTool
java.lang.Object
org.apache.xmlrpc.util.DateTool
public class DateTool
- extends java.lang.Object
Wraps a DateFormat instance to provide thread safety.
- Author:
- Hannes Wallnoefer, Daniel L. Rall
|
Field Summary |
private java.text.DateFormat |
df
|
protected static java.lang.String |
FORMAT
|
|
Constructor Summary |
DateTool()
Uses the DateFormat string
yyyyMMdd'T'HH:mm:ss. |
|
Method Summary |
java.lang.String |
format(java.util.Date d)
|
java.util.Date |
parse(java.lang.String s)
|
void |
setTimeZone(java.util.TimeZone z)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FORMAT
protected static final java.lang.String FORMAT
- See Also:
- Constant Field Values
df
private java.text.DateFormat df
DateTool
public DateTool()
- Uses the
DateFormat string
yyyyMMdd'T'HH:mm:ss.
- See Also:
FORMAT
format
public java.lang.String format(java.util.Date d)
- Parameters:
d - The date to format.
- Returns:
- The formatted date.
setTimeZone
public void setTimeZone(java.util.TimeZone z)
parse
public java.util.Date parse(java.lang.String s)
throws java.text.ParseException
- Parameters:
s - The text to parse a date from.
- Returns:
- The parsed date.
- Throws:
java.text.ParseException - If the date could not be parsed.
Copyright ? 1999-2002 Apache Software Foundation. All Rights Reserved.