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 String
format(Date date)
String
format(Date date, String pattern)
DateFormat
getDateFormatInstance()
Locale
getLocale()
String
getOutputFormat()
Deprecated.Use getPattern().String
getPattern()
TimeZone
getTimeZone()
Date
parse(String date)
Date
parse(String date, String pattern)
void
setDateFormatInstance(DateFormat dateFormat)
void
setLocale(Locale locale)
void
setOutputFormat(String pattern)
Deprecated.Use setPattern().void
setPattern(String pattern)
Set the pattern.void
setTimeZone(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
-
-