Package org.apache.log4j.lf5.util
Class DateFormatManager
- java.lang.Object
-
- org.apache.log4j.lf5.util.DateFormatManager
-
public class DateFormatManager extends Object
Date format manager. Utility class to help manage consistent date formatting and parsing. It may be advantageous to have multiple DateFormatManagers per application. For example, one for handling the output (formatting) of dates, and another one for handling the input (parsing) of dates.- Author:
- Robert Shaw, Michael J. Sikorsky
-
-
Constructor Summary
Constructors Constructor Description DateFormatManager()DateFormatManager(String pattern)DateFormatManager(Locale locale)DateFormatManager(Locale locale, String pattern)DateFormatManager(TimeZone timeZone)DateFormatManager(TimeZone timeZone, String pattern)DateFormatManager(TimeZone timeZone, Locale locale)DateFormatManager(TimeZone timeZone, Locale locale, String pattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringformat(Date date)Stringformat(Date date, String pattern)DateFormatgetDateFormatInstance()LocalegetLocale()StringgetOutputFormat()Deprecated.Use getPattern().StringgetPattern()TimeZonegetTimeZone()Dateparse(String date)Dateparse(String date, String pattern)voidsetDateFormatInstance(DateFormat dateFormat)voidsetLocale(Locale locale)voidsetOutputFormat(String pattern)Deprecated.Use setPattern().voidsetPattern(String pattern)Set the pattern.voidsetTimeZone(TimeZone timeZone)
-
-
-
Method Detail
-
getTimeZone
public TimeZone getTimeZone()
-
setTimeZone
public void setTimeZone(TimeZone timeZone)
-
getLocale
public Locale getLocale()
-
setLocale
public void setLocale(Locale locale)
-
getPattern
public String getPattern()
-
setPattern
public void setPattern(String pattern)
Set the pattern. i.e. "EEEEE, MMMMM d, yyyy hh:mm aaa"
-
getOutputFormat
public String getOutputFormat()
Deprecated.Use getPattern().This method has been deprecated in favour of getPattern().
-
setOutputFormat
public void setOutputFormat(String pattern)
Deprecated.Use setPattern().This method has been deprecated in favour of setPattern().
-
getDateFormatInstance
public DateFormat getDateFormatInstance()
-
setDateFormatInstance
public void setDateFormatInstance(DateFormat dateFormat)
-
parse
public Date parse(String date) throws ParseException
- Throws:
ParseException
-
parse
public Date parse(String date, String pattern) throws ParseException
- Throws:
ParseException
-
-