java.lang.Objectorg.objectweb.telosys.util.DateUtil
Utility class for DATE operations ( set of static methods )
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(java.util.Date date,
java.lang.String sFormat)
Format the given date using the given format |
static java.lang.String |
format(int iDay,
int iMonth,
int iYear)
Format the given day, month and year ( in ISO format ) |
static java.lang.String |
format(int iDay,
int iMonth,
int iYear,
java.lang.String sFormat)
Format the given day, month and year |
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 java.util.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.util.Date |
parseDate(java.lang.String sDate)
Parse the given date ( supposed to be in ISO format : "YYYY-MM-DD" ) |
static java.util.Date |
parseDateTime(java.lang.String sDateTime)
Parse the given date & time ( supposed to be in ISO format : "YYYY-MM-DD HH:MM:SS" ) |
static java.util.Date |
parseTime(java.lang.String sTime)
Parse the given time ( supposed to be in ISO format : "HH:MM:SS" ) |
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()
Returns the current date as java.sql.Date |
static java.lang.String |
todayString(java.lang.String sFormat)
Returns the current date as a String formated with the given format |
static java.util.Date |
todayUtilDate()
Returns the current date as java.util.Date |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.sql.Date todaySqlDate()
public static java.util.Date todayUtilDate()
public static java.lang.String todayString(java.lang.String sFormat)
sFormat
- :
public static java.lang.String format(int iDay, int iMonth, int iYear, java.lang.String sFormat)
iDay
- the day ( 1 to 31 )iMonth
- the month ( 1 to 12 )iYear
- the yearsFormat
- the format string usable to build a SimpleDateFormat
public static java.lang.String format(int iDay, int iMonth, int iYear)
iDay
- the day ( 1 to 31 )iMonth
- ( 1 to 12 )iYear
- the year
public static java.lang.String format(java.util.Date date, java.lang.String sFormat)
date
- sFormat
-
public static java.sql.Date getSqlDate(int iDay, int iMonth, int iYear)
iDay
- the day ( 1 to 31 )iMonth
- the month ( 1 to 12 )iYear
- the year
public static java.util.Date getUtilDate(int iDay, int iMonth, int iYear)
iDay
- the day ( 1 to 31 )iMonth
- the month ( 1 to 12 )iYear
- the year
public static int getDay(java.sql.Date date)
date
-
public static int getMonth(java.sql.Date date)
date
- :
public static int getYear(java.sql.Date date)
date
- :
public static java.lang.String dateISO(java.util.Date date)
date
-
public static java.lang.String timeISO(java.util.Date date)
date
-
public static java.lang.String dateTimeISO(java.util.Date date)
date
-
public static java.util.Date parseDate(java.lang.String sDate)
sDate
-
TelosysRuntimeException
- if the date is invalidpublic static java.util.Date parseTime(java.lang.String sTime)
sTime
-
TelosysRuntimeException
- if the time is invalidpublic static java.util.Date parseDateTime(java.lang.String sDateTime)
sDateTime
-
TelosysRuntimeException
- if the time is invalid