hoplugins.commons.utils
Class DateUtil

java.lang.Object
  extended byhoplugins.commons.utils.DateUtil

public final class DateUtil
extends java.lang.Object

Collection of Date Utility

Author:
Massimiliano Amato

Method Summary
static boolean equalsAsDays(java.util.Date date1, java.util.Date date2)
          Check if the two dates are in the same day
static int getDiffDays(java.util.Date startDate, java.util.Date endDate)
          Returns the number of full days between two dates
static java.util.Date resetDay(java.util.Date date)
          Reset the Date to midnight time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDiffDays

public static int getDiffDays(java.util.Date startDate,
                              java.util.Date endDate)
Returns the number of full days between two dates

Parameters:
startDate - Start date
endDate - End date
Returns:
number of days between start and end date

equalsAsDays

public static boolean equalsAsDays(java.util.Date date1,
                                   java.util.Date date2)
Check if the two dates are in the same day

Parameters:
date1 - Date 1
date2 - Date 2
Returns:
true, if both dates are in the same day, even at different time

resetDay

public static java.util.Date resetDay(java.util.Date date)
Reset the Date to midnight time

Parameters:
date - Date to reset
Returns:
a new Date at the same day but time set to midnight


Copyright © 2005 Hattrick Organizer Plugins Project. All Rights Reserved.