com.isomorphic.util.date

## Class DateUtil

- java.lang.Object
- - com.isomorphic.util.date.DateUtil

-     public class DateUtil
      extends java.lang.Object

  A utility class with various methods for dealing with dates, calendars and time.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.GregorianCalendar` | `createLogicalDate(int year, int month, int day)` Creates a logical date for the year, month and day provided.
    `static java.util.GregorianCalendar` | `createLogicalDate(int year, int month, int day, java.util.Locale locale)` Creates a logical date for the locale, year, month and day provided.
    `static java.util.GregorianCalendar` | `createLogicalDate(long millisecondsTimeStamp)` Creates a logical date for the locale and timestamp in milliseconds provided.
    `static java.util.GregorianCalendar` | `createLogicalDate(long millisecondsTimeStamp, java.util.Locale locale)` Creates a logical date for the locale and timestamp in milliseconds provided.
    `static java.util.GregorianCalendar` | `getAbsoluteDate(RelativeDate relativeDate, boolean isLogicalDate)` Gets the absolute date for a relative date with the current date and time as the relevance point.
    `static java.util.GregorianCalendar` | `getAbsoluteDate(RelativeDate relativeDate, java.util.Date baseDate, boolean isLogicalDate)` Gets the absolute date for a relative date with a base date and time as the relevance point.
    `static boolean` | `isRelativeDate(java.lang.Object value)` Checks if a value, usually criteria value, is a relative date.

- - ### Method Detail

    - #### getAbsoluteDate

          public static java.util.GregorianCalendar getAbsoluteDate(RelativeDate relativeDate,
                                                                    boolean isLogicalDate)

      Gets the absolute date for a relative date with the current date and time as the relevance point.
      Parameters:
        `isLogicalDate` - false if this date should include the time.
      Returns:
        a gregorian calendar.

    - #### getAbsoluteDate

          public static java.util.GregorianCalendar getAbsoluteDate(RelativeDate relativeDate,
                                                                    java.util.Date baseDate,
                                                                    boolean isLogicalDate)

      Gets the absolute date for a relative date with a base date and time as the relevance point.
      Parameters:
        `baseDate` - the relevance point to get the absolute date for.
        `isLogicalDate` - false if this date should include the time.
      Returns:
        a gregorian calendar.

    - #### isRelativeDate

          public static boolean isRelativeDate(java.lang.Object value)

      Checks if a value, usually criteria value, is a relative date.
      Parameters:
        `value` - the value to check.
      Returns:
        true if the value is a relative date, otherwise false.

    - #### createLogicalDate

          public static java.util.GregorianCalendar createLogicalDate(int year,
                                                                      int month,
                                                                      int day)

      Creates a logical date for the year, month and day provided. This method will default the locale to the servers current locale.
      Parameters:
        `year` - the year, such as 1984.
        `month` - the month, a value between 0 and 11 inclusive where 0 is January.
        `day` - the day of the month, a value between 1 and 31 inclusive.
      Returns:
        a GregorianCalendar representing the logical date.

    - #### createLogicalDate

          public static java.util.GregorianCalendar createLogicalDate(int year,
                                                                      int month,
                                                                      int day,
                                                                      java.util.Locale locale)

      Creates a logical date for the locale, year, month and day provided.
      Parameters:
        `year` - the year, such as 1984.
        `month` - the month, a value between 0 and 11 inclusive where 0 is January.
        `day` - the day of the month, a value between 1 and 31 inclusive.
        `locale` - the locale or time zone of the date to create.
      Returns:
        a GregorianCalendar representing the logical date.

    - #### createLogicalDate

          public static java.util.GregorianCalendar createLogicalDate(long millisecondsTimeStamp)

      Creates a logical date for the locale and timestamp in milliseconds provided. This method will default the locale to the servers current locale.
      Parameters:
        `millisecondsTimeStamp` - the timestamp in UTC milliseconds from the epoch.
      Returns:
        a GregorianCalendar representing the logical date.

    - #### createLogicalDate

          public static java.util.GregorianCalendar createLogicalDate(long millisecondsTimeStamp,
                                                                      java.util.Locale locale)

      Creates a logical date for the locale and timestamp in milliseconds provided.
      Parameters:
        `millisecondsTimeStamp` - the timestamp in UTC milliseconds from the epoch.
        `locale` - the locale or time zone of the date to create.
      Returns:
        a GregorianCalendar representing the logical date.