Package com.xffffff.wellfed.common
Class DateUtil
- java.lang.Object
-
- com.xffffff.wellfed.common.DateUtil
-
public class DateUtil extends java.lang.Object
The DateUtil class contains utility methods for dates.
-
-
Constructor Summary
Constructors Constructor Description DateUtil()
Constructs a DateUtil object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
beforeToday(java.util.Date date)
Returns true if the date is before todayboolean
equals(java.util.Date date1, java.util.Date date2)
Returns true if two dates are equalint
format(java.util.Date date)
java.lang.String
format(java.util.Date date, java.lang.String pattern)
Returns the date as a string in the format specified by the patternjava.util.Date
getFirstDayOfWeek(java.util.Date date)
java.util.Date
getLastDayOfWeek(java.util.Date date)
Returns the date of the last day of the week.
-
-
-
Method Detail
-
equals
public boolean equals(java.util.Date date1, java.util.Date date2)
Returns true if two dates are equal- Parameters:
date1
- the first datedate2
- the second date- Returns:
- true if two dates are equal
-
getFirstDayOfWeek
public java.util.Date getFirstDayOfWeek(java.util.Date date)
-
getLastDayOfWeek
public java.util.Date getLastDayOfWeek(java.util.Date date)
Returns the date of the last day of the week.- Parameters:
date
- the date- Returns:
- the date of the last day of the week
-
format
public java.lang.String format(java.util.Date date, java.lang.String pattern)
Returns the date as a string in the format specified by the pattern- Parameters:
date
- the datepattern
- the patternSimpleDateFormat
- Returns:
- the date as a string in the format specified by the pattern
-
format
public int format(java.util.Date date)
-
beforeToday
public java.lang.Boolean beforeToday(java.util.Date date)
Returns true if the date is before today- Parameters:
date
- the date- Returns:
- true if the date is before today
-
-