|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mancrd.ahah.commons.utils.DateUtils
public final class DateUtils
Method Summary | |
---|---|
static Date |
addDays(Date date,
int days)
Add days to a date. |
static Date |
addHours(Date date,
int hours)
Add hours to a date. |
static Date |
addMinutes(Date date,
int minutes)
Add minutes to a date. |
static Date |
addMonths(Date date,
int months)
Add months to a date. |
static Date |
addSeconds(Date date,
int seconds)
Add seconds to a date. |
static Date |
addYears(Date date,
int years)
Add years to a date. |
static Date |
createTruncatedDate()
Creates a current Date without timestamp |
static Date |
getDateFromString(String dateString,
String formatString)
Given a Date String and a format String, returns a Date Object |
static String |
getDateSQLString(Date date)
|
static String |
getDateTimeSQLString(Date date)
|
static long |
getDifferenceInDays(Date from,
Date to)
|
static Date |
getLastDayOfMonth(Date date)
|
static Date |
getLastDayOfPreviousMonth(Date date)
|
static Date |
getNextBusinessDay(Date date)
|
static int |
getTimezoneDifference(String timezone1,
String timezone2)
|
static boolean |
isFirstDayOfMonth(Date date)
Check if given date is the first of the month |
static boolean |
isNear(Date date1,
Date date2,
int days)
Checks if the first date is near to the second date within the number of days specified |
static boolean |
isSameDate(Date date1,
Date date2)
Check if two Date objects are the same date |
static boolean |
isSameDateTime(Date date1,
Date date2)
|
static boolean |
isToday(Date date)
Check if the given date is today |
static Date |
removeTimestamp(Date date)
Removes the timestamp portion of a date |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Date getDateFromString(String dateString, String formatString) throws ParseException
dateString
- formatString
-
ParseException
public static Date addYears(Date date, int years)
date
- years
-
public static Date addMonths(Date date, int months)
date
- months
-
public static Date addDays(Date date, int days)
date
- days
-
public static Date addHours(Date date, int hours)
date
- hours
-
public static Date addMinutes(Date date, int minutes)
date
- minutes
-
public static Date addSeconds(Date date, int seconds)
date
- seconds
-
public static boolean isNear(Date date1, Date date2, int days)
date1
- date2
- days
-
public static Date removeTimestamp(Date date)
date
-
public static String getDateSQLString(Date date)
public static String getDateTimeSQLString(Date date)
public static boolean isToday(Date date)
date
-
public static boolean isSameDate(Date date1, Date date2)
date1
- date2
-
public static boolean isFirstDayOfMonth(Date date)
date
-
public static Date getLastDayOfPreviousMonth(Date date)
public static Date getLastDayOfMonth(Date date)
public static Date createTruncatedDate()
public static long getDifferenceInDays(Date from, Date to)
public static Date getNextBusinessDay(Date date)
public static boolean isSameDateTime(Date date1, Date date2)
public static int getTimezoneDifference(String timezone1, String timezone2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |