org.apache.xmlrpc.util
Class DateTool

java.lang.Object
  extended byorg.apache.xmlrpc.util.DateTool

public class DateTool
extends java.lang.Object

Wraps a DateFormat instance to provide thread safety.

Author:
Hannes Wallnoefer, Daniel 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FORMAT

protected static final java.lang.String FORMAT
See Also:
Constant Field Values

df

private java.text.DateFormat df
Constructor Detail

DateTool

public DateTool()
Uses the DateFormat string yyyyMMdd'T'HH:mm:ss.

See Also:
FORMAT
Method Detail

format

public java.lang.String format(java.util.Date d)
Parameters:
d - The date to format.
Returns:
The formatted date.

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 © ${year} Apache Software Foundation. All Rights Reserved.