public class DateUtils
extends org.apache.commons.lang.time.DateUtils
MILLIS_IN_DAY, MILLIS_IN_HOUR, MILLIS_IN_MINUTE, MILLIS_IN_SECOND, MILLIS_PER_DAY, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND, RANGE_MONTH_MONDAY, RANGE_MONTH_SUNDAY, RANGE_WEEK_CENTER, RANGE_WEEK_MONDAY, RANGE_WEEK_RELATIVE, RANGE_WEEK_SUNDAY, SEMI_MONTH, UTC_TIME_ZONE| Constructor and Description |
|---|
DateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Date |
clearTimeFields(Date date)
Convert the given java.sql.date into a java.sql.date of which all the time fields are set to 0.
|
static Date |
clearTimeFields(Date date)
Convert the given java.util.date into a java.util.date of which all the time fields are set to 0.
|
static Date |
convertToSqlDate(Date date)
Converts the given java.util.Date into an equivalent java.sql.Date
|
static double |
getDifferenceInDays(Timestamp startDateTime,
Timestamp endDateTime) |
static double |
getDifferenceInHours(Timestamp startDateTime,
Timestamp endDateTime) |
static boolean |
isSameDay(Calendar cal1,
Calendar cal2)
Adds null-safety to commons.DateUtils isSameDay method.
|
static boolean |
isSameDay(Date date1,
Date date2)
Adds null-safety to commons.DateUtils isSameDay method.
|
static Date |
newDate(Integer year,
Integer month,
Integer day)
This method is a utility method to create a new java.sql.Date in one line.
|
static Date |
newDate(Integer year,
Integer month,
Integer day,
Integer hour,
Integer minute,
Integer second)
This method is a utility method to create a new java.sql.Date in one line.
|
add, addDays, addHours, addMilliseconds, addMinutes, addMonths, addSeconds, addWeeks, addYears, ceiling, ceiling, ceiling, getFragmentInDays, getFragmentInDays, getFragmentInHours, getFragmentInHours, getFragmentInMilliseconds, getFragmentInMilliseconds, getFragmentInMinutes, getFragmentInMinutes, getFragmentInSeconds, getFragmentInSeconds, isSameInstant, isSameInstant, isSameLocalTime, iterator, iterator, iterator, parseDate, parseDateStrictly, round, round, round, setDays, setHours, setMilliseconds, setMinutes, setMonths, setSeconds, setYears, toCalendar, truncate, truncate, truncate, truncatedCompareTo, truncatedCompareTo, truncatedEquals, truncatedEqualspublic static boolean isSameDay(Date date1, Date date2)
public static boolean isSameDay(Calendar cal1, Calendar cal2)
public static Date convertToSqlDate(Date date)
date - public static Date clearTimeFields(Date date)
date - public static Date clearTimeFields(Date date)
date - public static double getDifferenceInDays(Timestamp startDateTime, Timestamp endDateTime)
startDateTime - endDateTime - public static double getDifferenceInHours(Timestamp startDateTime, Timestamp endDateTime)
startDateTime - endDateTime - public static Date newDate(Integer year, Integer month, Integer day)
year - month - day - public static Date newDate(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second)
year - month - day - hour - minute - second - Copyright © 2013 The Kuali Foundation. All Rights Reserved.