org.slim3.commons.util
Class SqlDateUtil

java.lang.Object
  extended by org.slim3.commons.util.SqlDateUtil

public final class SqlDateUtil
extends Object

A utility class for Date.

Version:
3.0
Author:
higa

Method Summary
static Date toDate(Object o)
          Converts the object to Date.
static Date toDate(String text, String pattern)
          Converts the text to Date.
static String toString(Date value, String pattern)
          Converts the Date value to text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

toDate

public static Date toDate(Object o)
Converts the object to Date.

Parameters:
o - the object
Returns:
the converted value

toDate

public static Date toDate(String text,
                          String pattern)
                   throws NullPointerException,
                          ParseRuntimeException
Converts the text to Date.

Parameters:
text - the text
pattern - the pattern for SimpleDateFormat
Returns:
the converted value
Throws:
NullPointerException - if the pattern parameter is null
ParseRuntimeException - if ParseException is encountered

toString

public static String toString(Date value,
                              String pattern)
Converts the Date value to text.

Parameters:
value - the Date value
pattern - the pattern for SimpleDateFormat
Returns:
the converted value


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.