org.vizzini.util
Class DateUtilities

java.lang.Object
  extended by org.vizzini.util.DateUtilities

public class DateUtilities
extends Object

Utility class for performing date related operations.

Author:
Jeffrey M. Thompson

Field Summary
static String DATE_PATTERN
          Date pattern.
static String DATE_TIME_PATTERN
          Date-time pattern.
 
Method Summary
 Date convertDateStringToDateObject(String dateString, String datePattern)
          Return a Date object from the given date and given date pattern.
 String convertDateTimeToString(Date date)
          Return a formatted string from the given date.
 String convertDateToString(Date date)
          Return a formatted string from the given date.
 String convertDateToString(Date date, String datePattern)
          Return a formatted string from the given date and given date pattern.
static DateUtilities getInstance()
          Return the singleton instance of this class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DATE_PATTERN

public static final String DATE_PATTERN
Date pattern.

See Also:
Constant Field Values

DATE_TIME_PATTERN

public static final String DATE_TIME_PATTERN
Date-time pattern.

See Also:
Constant Field Values
Method Detail

getInstance

public static DateUtilities getInstance()
Return the singleton instance of this class.


convertDateStringToDateObject

public Date convertDateStringToDateObject(String dateString,
                                          String datePattern)
Return a Date object from the given date and given date pattern.

Parameters:
dateString - A string representation of a date.
datePattern - The date pattern, such as MM/dd/yyyy.
Returns:
a Date object.

convertDateTimeToString

public String convertDateTimeToString(Date date)
Return a formatted string from the given date. Uses the default pattern of "yyyy-MM-dd HH:mm:ss".

Parameters:
date - Date.
Returns:
The date in String form.

convertDateToString

public String convertDateToString(Date date)
Return a formatted string from the given date. Uses the default pattern of "yyyy-MM-dd".

Parameters:
date - Date.
Returns:
The date in String form.

convertDateToString

public String convertDateToString(Date date,
                                  String datePattern)
Return a formatted string from the given date and given date pattern.

Parameters:
date - Date.
datePattern - Date pattern, such as MM/dd/yyyy.
Returns:
The date in String form.


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02