| org.kuali.core.util.DateUtils
DateUtils | public class DateUtils extends org.apache.commons.lang.time.DateUtils (Code) | | Utility methods for comparing dates
|
Method Summary | |
public static java.sql.Date | clearTimeFields(java.sql.Date date) Convert the given java.sql.date into a java.sql.date of which all the time fields are set to 0. | public static java.util.Date | clearTimeFields(java.util.Date date) Convert the given java.util.date into a java.util.date of which all the time fields are set to 0. | public static java.sql.Date | convertToSqlDate(java.util.Date date) | public static double | getDifferenceInDays(Timestamp startDateTime, Timestamp endDateTime) | public static double | getDifferenceInHours(Timestamp startDateTime, Timestamp endDateTime) | public static boolean | isSameDay(Date date1, Date date2) Adds null-safety to commons.DateUtils isSameDay method. | public static boolean | isSameDay(Calendar cal1, Calendar cal2) Adds null-safety to commons.DateUtils isSameDay method. | public static java.sql.Date | newDate(Integer year, Integer month, Integer day) This method is a utility method to create a new java.sql.Date in one line. | public static java.sql.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. |
clearTimeFields | public static java.sql.Date clearTimeFields(java.sql.Date date)(Code) | | Convert the given java.sql.date into a java.sql.date of which all the time fields are set to 0.
Parameters: date - |
clearTimeFields | public static java.util.Date clearTimeFields(java.util.Date date)(Code) | | Convert the given java.util.date into a java.util.date of which all the time fields are set to 0.
Parameters: date - |
convertToSqlDate | public static java.sql.Date convertToSqlDate(java.util.Date date)(Code) | | Converts the given java.util.Date into an equivalent java.sql.Date
Parameters: date - java.sql.Date constructed from the given java.util.Date |
getDifferenceInDays | public static double getDifferenceInDays(Timestamp startDateTime, Timestamp endDateTime)(Code) | | Parameters: startDateTime - Parameters: endDateTime - the difference in days between the second timestamp and first |
getDifferenceInHours | public static double getDifferenceInHours(Timestamp startDateTime, Timestamp endDateTime)(Code) | | Parameters: startDateTime - Parameters: endDateTime - the difference in hours between the second timestamp and first |
isSameDay | public static boolean isSameDay(Date date1, Date date2)(Code) | | Adds null-safety to commons.DateUtils isSameDay method.
true if both dates are null or represent the same day |
isSameDay | public static boolean isSameDay(Calendar cal1, Calendar cal2)(Code) | | Adds null-safety to commons.DateUtils isSameDay method.
true if both calendars are null or represent the same day |
newDate | public static java.sql.Date newDate(Integer year, Integer month, Integer day)(Code) | | This method is a utility method to create a new java.sql.Date in one line.
Parameters: year - Parameters: month - Parameters: day - a populated java.sql.Date with the year, month, and day specified, and no values for hour, minute, second,millisecond |
newDate | public static java.sql.Date newDate(Integer year, Integer month, Integer day, Integer hour, Integer minute, Integer second)(Code) | | This method is a utility method to create a new java.sql.Date in one line.
Parameters: year - Parameters: month - Parameters: day - Parameters: hour - Parameters: minute - Parameters: second - a populated java.sql.Date with the year, month, hour, minute, and second populated, with no value for millisecond. |
|
|