Class DateTool

java.lang.Object
org.openl.util.DateTool

public class DateTool extends Object
  • Field Details

  • Constructor Details

    • DateTool

      public DateTool()
  • Method Details

    • absMonth

      public static Integer absMonth(Date d)
    • absQuarter

      public static Integer absQuarter(Date d)
    • dayDiff

      public static Integer dayDiff(Date endDate, Date startDate)
    • dayOfWeek

      public static Integer dayOfWeek(Date d)
    • dayOfMonth

      public static Integer dayOfMonth(Date d)
    • dayOfYear

      public static Integer dayOfYear(Date d)
    • weekOfMonth

      public static Integer weekOfMonth(Date d)
    • weekOfYear

      public static Integer weekOfYear(Date d)
    • firstDateOfQuarter

      public static Date firstDateOfQuarter(int absQuarter)
    • lastDateOfQuarter

      public static Date lastDateOfQuarter(int absQuarter)
    • lastDayOfMonth

      public static Integer lastDayOfMonth(Date d)
    • monthDiff

      public static Integer monthDiff(Date endDate, Date startDate)
    • yearDiff

      public static Integer yearDiff(Date endDate, Date startDate)
    • weekDiff

      public static Integer weekDiff(Date endDate, Date startDate)
    • quarter

      public static Integer quarter(Date d)
    • second

      public static Integer second(Date d)
    • minute

      public static Integer minute(Date d)
    • hour

      public static Integer hour(Date d)
      Parameters:
      d - Date
      Returns:
      hour from 0 to 12
    • hourOfDay

      public static Integer hourOfDay(Date d)
      Parameters:
      d - Date
      Returns:
      hour from 0 to 24
    • month

      public static Integer month(Date d)
    • year

      public static Integer year(Date d)
    • amPm

      public static String amPm(Date d)
    • dateToString

      public static String dateToString(Date date, String dateFormat)
      Converts a date to the String value according the dateFormat
      Parameters:
      date - a date which should be converted
      dateFormat -
      Returns:
      String date format
    • dateToString

      public static String dateToString(Date date)
      Converts a date to the String value according the default locale.
      Parameters:
      date -
      Returns:
      String date format