org.objectweb.telosys.util
Class DateUtil

java.lang.Object
  extended byorg.objectweb.telosys.util.DateUtil

public final class DateUtil
extends java.lang.Object


Method Summary
static java.lang.String dateISO(java.util.Date date)
          Returns the given date as an ISO date string ( "YYYY-MM-DD" )
static java.lang.String dateTimeISO(java.util.Date date)
          Returns the given date as an ISO date and time string ( "YYYY-MM-DD HH:MM:SS" )
static java.lang.String format(int iDay, int iMonth, int iYear)
           
static java.lang.String format(int iJ, int iM, int iA, java.lang.String sFormat)
           
static int getDay(java.sql.Date date)
          Returns the day of the month for the given date
static int getMonth(java.sql.Date date)
          Returns the month of the given date
static java.sql.Date getSqlDate(int iDay, int iMonth, int iYear)
          Returns a java.sql.Date instance for the given day, month and year
static java.util.Date getUtilDate(int iDay, int iMonth, int iYear)
          Returns a standard Date instance for the given day, month and year
static int getYear(java.sql.Date date)
          Returns the year of the given date
static java.lang.String timeISO(java.util.Date date)
          Returns the given date as an ISO time string ( "HH:MM:SS" )
static java.sql.Date todaySqlDate()
           
static java.lang.String todayString(java.lang.String sFormat)
           
static java.util.Date todayUtilDate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

todaySqlDate

public static java.sql.Date todaySqlDate()
Returns:
java.sql.Date :

todayUtilDate

public static java.util.Date todayUtilDate()
Returns:
java.util.Date :

todayString

public static java.lang.String todayString(java.lang.String sFormat)
Parameters:
sFormat - :
Returns:
String :

format

public static java.lang.String format(int iJ,
                                      int iM,
                                      int iA,
                                      java.lang.String sFormat)
Parameters:
iJ - :
iM - :
iA - :
sFormat - : format string usable to build a SimpleDateFormat
Returns:
: the formated date ( using the given format )

format

public static java.lang.String format(int iDay,
                                      int iMonth,
                                      int iYear)
Parameters:
iDay - :
iMonth - :
iYear - :
Returns:
: the formated date ( using the default ISO format )

getSqlDate

public static java.sql.Date getSqlDate(int iDay,
                                       int iMonth,
                                       int iYear)
Returns a java.sql.Date instance for the given day, month and year

Parameters:
iDay - :
iMonth - :
iYear - :
Returns:
java.sql.Date :

getUtilDate

public static java.util.Date getUtilDate(int iDay,
                                         int iMonth,
                                         int iYear)
Returns a standard Date instance for the given day, month and year

Parameters:
iDay - : 1 to 31
iMonth - : 1 to 12
iYear - :
Returns:
java.util.Date :

getDay

public static int getDay(java.sql.Date date)
Returns the day of the month for the given date

Parameters:
date - :
Returns:
int : 0 to 31

getMonth

public static int getMonth(java.sql.Date date)
Returns the month of the given date

Parameters:
date - :
Returns:
int : 1 to 12

getYear

public static int getYear(java.sql.Date date)
Returns the year of the given date

Parameters:
date - :
Returns:
int :

dateISO

public static java.lang.String dateISO(java.util.Date date)
Returns the given date as an ISO date string ( "YYYY-MM-DD" )

Parameters:
date -
Returns:
the date in ISO string format ( or "" if null )

timeISO

public static java.lang.String timeISO(java.util.Date date)
Returns the given date as an ISO time string ( "HH:MM:SS" )

Parameters:
date -
Returns:
the time in ISO string format ( or "" if null )

dateTimeISO

public static java.lang.String dateTimeISO(java.util.Date date)
Returns the given date as an ISO date and time string ( "YYYY-MM-DD HH:MM:SS" )

Parameters:
date -
Returns:
the date and time in ISO string format ( or "" if null )