java.lang.Object
com.github.mjeanroy.junit.servers.commons.lang.Dates

public final class Dates extends Object
Static date utilities.

Internal API: these methods are part of the internal API and may be removed, have their signature change, or have their access level decreased from public to protected, package, or private in future versions without notice.

  • Method Details

    • getTime

      public static Long getTime(String date, String pattern, String... patterns)
      Parse date using given pattern and return time value. Note that this method will return null if pattern is not valid or throws a ParseException.
      Parameters:
      date - Date.
      pattern - Pattern.
      patterns - Other pattern to test.
      Returns:
      Time value, null if pattern is not valid.
    • format

      public static String format(Date date, String pattern)
      Format date according to given pattern.
      Parameters:
      date - Date.
      pattern - Pattern.
      Returns:
      Formatted date.