org.apache.xmlrpc.util

Class DateTool

public class DateTool extends Object

Wraps a DateFormat instance to provide thread safety.

Author: Hannes Wallnoefer Daniel L. Rall

Field Summary
DateFormatdf
protected static StringFORMAT
Constructor Summary
DateTool()
Uses the DateFormat string yyyyMMdd'T'HH:mm:ss.
Method Summary
Stringformat(Date d)
Dateparse(String s)
voidsetTimeZone(TimeZone z)

Field Detail

df

private DateFormat df

FORMAT

protected static final String FORMAT

Constructor Detail

DateTool

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

See Also: FORMAT

Method Detail

format

public String format(Date d)

Parameters: d The date to format.

Returns: The formatted date.

parse

public Date parse(String s)

Parameters: s The text to parse a date from.

Returns: The parsed date.

Throws: ParseException If the date could not be parsed.

setTimeZone

public void setTimeZone(TimeZone z)
Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.