Class DateUtil

java.lang.Object
org.cdlib.mrt.utility.DateUtil

public class DateUtil extends Object
Author:
dloy
  • Field Details

  • Constructor Details

    • DateUtil

      public DateUtil()
  • Method Details

    • getCurrentDate

      public static Date getCurrentDate()
      get current Date
      Returns:
      current Date
    • getCurrentDatePlus

      public static Date getCurrentDatePlus(long millSecs)
      return the Date for current + millisecond update
      Parameters:
      millSecs - adjust for current date
      Returns:
      adjusted time
    • getCurrentDateString

      public static String getCurrentDateString(String pattern)
      return String form of current date using passed pattern
      Parameters:
      pattern - pattern for building returned String
      Returns:
      formatted current Date
    • getDateString

      public static String getDateString(Date date, String pattern)
      Return String formatted form of passed Date
      Parameters:
      date - Date to format
      pattern - pattern to use for formatting
      Returns:
      formatted passed Date
    • getDateFromString

      public static Date getDateFromString(String stringDate, String pattern)
      Build a Date object using a String with an extraction pattern
      Parameters:
      stringDate -
      pattern -
      Returns:
    • getIsoDateFromString

      public static Date getIsoDateFromString(String stringDate)
      Build Date from a displayed IsoDate string
      Parameters:
      stringDate - iso string to convert to Date
      Returns:
      converted Date
    • getIsoDateFromZString

      public static Date getIsoDateFromZString(String stringDate)
      Build Date from a displayed IsoDate string
      Parameters:
      stringDate - iso string to convert to Date
      Returns:
      converted Date
    • getCurrentIsoDate

      public static String getCurrentIsoDate()
      Get the current IsoDate String
      Returns:
      current IsoDate
    • getIsoDate

      public static String getIsoDate(Date date)
      Build an IsoDate from a passed Date
      Parameters:
      date - to conver to displayed IsoDate
      Returns:
      displayed IsoDate
    • getIsoZDate

      public static String getIsoZDate(Date date)
      Build an IsoDate from a passed Date
      Parameters:
      date - to conver to displayed IsoDate
      Returns:
      displayed IsoDate
    • getEpochUTCDate

      public static long getEpochUTCDate()
      Get current date a Epoch seconds
      Returns:
      Epoch second for current date