org.apache.xmlrpc.util

Class DateTool


public class DateTool
extends java.lang.Object

Wraps a DateFormat instance to provide thread safety.
Authors:
Hannes Wallnoefer
Daniel L. Rall

Field Summary

protected static String
FORMAT
private DateFormat
df

Constructor Summary

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

Method Summary

String
format(Date d)
Date
parse(String s)
void
setTimeZone(TimeZone z)

Field Details

FORMAT

protected static final String FORMAT

df

private DateFormat df

Constructor Details

DateTool

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

Method Details

format

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

parse

public Date parse(String s)
            throws ParseException
Parameters:
s - The text to parse a date from.
Returns:
The parsed date.

setTimeZone

public void setTimeZone(TimeZone z)

Copyright B) 1999-2002 Apache Software Foundation. All Rights Reserved.