Package com.portal.pfc.util
Class DateUtility
java.lang.Object
com.portal.pfc.util.DateUtility
A general set of methods for determining information about a date.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intgetCalendarField(Date d, int field) static intgetCalendarField(Date d, int field, Calendar cal) static DategetDate()returns a date object based on the current time, but with the milliseconds zeroed out.static DategetDate(int year, int month, int date) Returns a date object based on the default time zone and locale.static DategetDate(int year, int month, int date, int hour, int minute) Returns a date object based on the default time zone and locale.static DategetDate(int year, int month, int date, int hour, int minute, int second) Returns a date object based on the default time zone and locale.static DateReturns a date object based on the default time zone and locale.static DateReturns a date object based on the default time zone and locale.static DateReturns a date object based on the default time zone and locale.static Datestatic intReturns the day of the month.static intReturns the day of the month.static intReturns the day of the week.static intstatic intgetMinutes(Date d, Calendar cal) static intReturns the month number.static intReturns the month number.static intgetSeconds(Date d, Calendar cal) static intReturns the year.static intReturns the year.static intlastDayInMonth(int month, int year) Returns the last day of the month.static intnumberOfWeeks(int month, int year)
-
Constructor Details
-
DateUtility
public DateUtility()
-
-
Method Details
-
lastDayInMonth
public static int lastDayInMonth(int month, int year) Returns the last day of the month. -
numberOfWeeks
public static int numberOfWeeks(int month, int year) -
getDate
Returns a date object based on the default time zone and locale. -
getDate
Returns a date object based on the default time zone and locale. -
getDate
Returns a date object based on the default time zone and locale. -
getDate
Returns a date object based on the default time zone and locale. -
getDate
Returns a date object based on the default time zone and locale. -
getDate
returns a date object based on the current time, but with the milliseconds zeroed out. -
getDate
-
getDate
public static Date getDate(int year, int month, int date, int hour, int minute, int second, Calendar cal) Returns a date object based on the default time zone and locale. -
getMonth
Returns the month number. January = 0, February = 1, ... -
getMonth
Returns the month number. January = 0, February = 1, ... -
getYear
Returns the year. -
getYear
Returns the year. -
getDay
Returns the day of the week. Sunday = 1, Monday = 2, Tuesday = 3... -
getDate
Returns the day of the month. -
getDate
Returns the day of the month. -
getHours
-
getMinutes
-
getSeconds
-
getCalendarField
-
getCalendarField
-