Class DateUtil

java.lang.Object
eu.c6.gibraltar.api.common.DateUtil

public class DateUtil extends Object
  • Constructor Details

    • DateUtil

      public DateUtil()
  • Method Details

    • isDate

      public static boolean isDate(String strDate)
    • toISO8601String

      public static String toISO8601String(Date date)
    • toISO8601String

      public static String toISO8601String(Date date, TimeZone timeZone)
    • fromISO8601String

      public static Date fromISO8601String(String strDate) throws ParseException
      Throws:
      ParseException
    • toGMTString

      public static String toGMTString(Date date)
    • toGMTString

      public static String toGMTString(LocalDate localDate)
    • getDateWithTime

      public static Date getDateWithTime(Date date, String time) throws ParseException
      Throws:
      ParseException
    • toLocalDate

      public static LocalDate toLocalDate(Date date)
    • toDate

      public static Date toDate(LocalDate localDate)
    • areEqual

      public static boolean areEqual(Date value1, Date value2)
      Check if two date are equals even if they are null
      Parameters:
      date - Date to check.
      Returns:
      true if the date is null or empty.
    • getPeriod

      public static Period getPeriod(String strRententionPeriod, Period defaultPeriod)
    • getFirstDayOfTheYear

      public static Date getFirstDayOfTheYear(Date date, TimeZone timezone)
    • getLastDayOfTheYear

      public static Date getLastDayOfTheYear(Date date, TimeZone timezone)