Package com.portal.ctrl
Class DateUtility
java.lang.Object
com.portal.ctrl.DateUtility
A general set of methods for determining information about a date.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
getCalendarField
(Date d, int field) static int
getCalendarField
(Date d, int field, Calendar cal) static Date
getDate()
returns a date object based on the current time, but with the milliseconds zeroed out.static Date
getDate
(int year, int month, int date) Returns a date object based on the default time zone and locale.static Date
getDate
(int year, int month, int date, int hour, int minute) Returns a date object based on the default time zone and locale.static Date
getDate
(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 Date
Returns a date object based on the default time zone and locale.static Date
Returns a date object based on the default time zone and locale.static Date
Returns a date object based on the default time zone and locale.static Date
static int
Returns the day of the month.static int
Returns the day of the month.static int
Returns the day of the week.static int
static int
getMinutes
(Date d, Calendar cal) static int
Returns the month number.static int
Returns the month number.static int
getSeconds
(Date d, Calendar cal) static int
Returns the year.static int
Returns the year.static int
lastDayInMonth
(int month, int year) Returns the last day of the month.static int
numberOfWeeks
(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
-