javatools.util
Class DateUtil

java.lang.Object
  |
  +--javatools.util.DateUtil

public class DateUtil
extends java.lang.Object

A utility class for use with dates.


Field Summary
(package private) static java.sql.Date _minusInfinity
           
(package private) static java.sql.Date _plusInfinity
           
(package private) static int FEB
           
(package private) static int LEAP_DAYS_IN_FEB
           
 
Constructor Summary
DateUtil()
           
 
Method Summary
static int daysInMonth(int month, int year)
          Month is zero based.
(package private) static void init()
           
static boolean leapYear(int year)
           
static int maxMonthSize(int month)
           
static java.sql.Date minusInfinity()
          Return a date represting a long time in the past.
static int monthSize(int month)
           
static java.sql.Date plusInfinity()
          Return a date representing a long time in the future.
static java.sql.Timestamp timestampNow()
          Return a Timestamp object representing the time now.
static boolean validDate(int date, int month, int year)
          month is zero based.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_minusInfinity

static java.sql.Date _minusInfinity

_plusInfinity

static java.sql.Date _plusInfinity

LEAP_DAYS_IN_FEB

static final int LEAP_DAYS_IN_FEB
See Also:
Constant Field Values

FEB

static final int FEB
See Also:
Constant Field Values
Constructor Detail

DateUtil

public DateUtil()
Method Detail

minusInfinity

public static java.sql.Date minusInfinity()
Return a date represting a long time in the past.

Returns:
Description of the Returned Value

plusInfinity

public static java.sql.Date plusInfinity()
Return a date representing a long time in the future. Sometimes people who don't like to use NULL values in databases use this as a kind of NULL value. Alternatively it can be sometimes useful in a SELECT to force use of an index.

Returns:
Description of the Returned Value

timestampNow

public static java.sql.Timestamp timestampNow()
Return a Timestamp object representing the time now.

Returns:
Description of the Returned Value

leapYear

public static boolean leapYear(int year)

monthSize

public static int monthSize(int month)

maxMonthSize

public static int maxMonthSize(int month)

daysInMonth

public static int daysInMonth(int month,
                              int year)
Month is zero based.

Parameters:
month - Description of Parameter
year - Description of Parameter
Returns:
Description of the Returned Value

validDate

public static boolean validDate(int date,
                                int month,
                                int year)
month is zero based. date is not.

Parameters:
date - Description of Parameter
month - Description of Parameter
year - Description of Parameter
Returns:
Description of the Returned Value

init

static void init()