Class DateUtility

java.lang.Object
com.portal.ctrl.DateUtility

public class DateUtility extends Object
A general set of methods for determining information about a date.
  • 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

      public static Date getDate(int year, int month, int date)
      Returns a date object based on the default time zone and locale.
    • getDate

      public static Date getDate(int year, int month, int date, Calendar cal)
      Returns a date object based on the default time zone and locale.
    • getDate

      public 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.
    • getDate

      public static Date getDate(int year, int month, int date, int hour, int minute, Calendar cal)
      Returns a date object based on the default time zone and locale.
    • getDate

      public 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.
    • getDate

      public static Date getDate()
      returns a date object based on the current time, but with the milliseconds zeroed out.
    • getDate

      public static Date getDate(Calendar cal)
    • 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

      public static int getMonth(Date d)
      Returns the month number. January = 0, February = 1, ...
    • getMonth

      public static int getMonth(Date d, Calendar cal)
      Returns the month number. January = 0, February = 1, ...
    • getYear

      public static int getYear(Date d)
      Returns the year.
    • getYear

      public static int getYear(Date d, Calendar cal)
      Returns the year.
    • getDay

      public static int getDay(Date d)
      Returns the day of the week. Sunday = 1, Monday = 2, Tuesday = 3...
    • getDate

      public static int getDate(Date d)
      Returns the day of the month.
    • getDate

      public static int getDate(Date d, Calendar cal)
      Returns the day of the month.
    • getHours

      public static int getHours(Date d, Calendar cal)
    • getMinutes

      public static int getMinutes(Date d, Calendar cal)
    • getSeconds

      public static int getSeconds(Date d, Calendar cal)
    • getCalendarField

      public static int getCalendarField(Date d, int field)
    • getCalendarField

      public static int getCalendarField(Date d, int field, Calendar cal)