org.obe.util
Class DateUtilities
java.lang.Object
org.obe.util.DateUtilities
- public final class DateUtilities
- extends java.lang.Object
Date formatting and parsing utilities. This is not a threadsafe class. Each
thread must call the getInstance()
method to obtain its own dedicated
instance.
- Author:
- Anthony Eden, Adrian Price
Method Summary |
java.lang.String |
format(java.util.Date date)
|
java.text.DateFormat[] |
getFormats()
|
static DateUtilities |
getInstance()
Get an instance of the DateUtilities class for the current thread. |
java.util.Date |
parse(java.lang.String dateString)
Parse the specified date string. |
void |
setFormats(java.text.DateFormat[] formats)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_DATE_FORMAT
public static final java.lang.String DEFAULT_DATE_FORMAT
getInstance
public static DateUtilities getInstance()
- Get an instance of the DateUtilities class for the current thread.
- Returns:
- A DateUtilities instance
setFormats
public void setFormats(java.text.DateFormat[] formats)
getFormats
public java.text.DateFormat[] getFormats()
parse
public java.util.Date parse(java.lang.String dateString)
throws java.text.ParseException
- Parse the specified date string.
- Parameters:
dateString
- The date string
- Returns:
- The Date object.
- Throws:
java.text.ParseException
- if the date format is not supported.
format
public java.lang.String format(java.util.Date date)
OBE-1.0 Copyright (c) 2002-2006 Adrian Price. All Rights Reserved.