Class DateUtils

java.lang.Object
org.apache.directory.api.util.DateUtils

public final class DateUtils extends Object
Gets the generalized time using the "Z" form of the g-time-zone.
Author:
Apache Directory Project
  • Method Details

    • getDate

      public static Date getDate(String zuluTime)
      Converts a generalized time string to a Date object.
      Parameters:
      zuluTime - the generalized time string
      Returns:
      the converted data
    • getGeneralizedTime

      public static String getGeneralizedTime(TimeProvider timeProvider)
      Gets the generalized time right now. GeneralizedTime
      Parameters:
      timeProvider - The Time provider to use to generate a time
      Returns:
      the generalizedTime right now
    • getGeneralizedTime

      public static String getGeneralizedTime(Date date)
      Create a GeneralizedTime based on a Date instance
      Parameters:
      date - the date to be converted to generalized time string
      Returns:
      given date in the generalized time string format
      See Also:
    • getGeneralizedTime

      public static String getGeneralizedTime(long time)
      Create a GeneralizedTime based on a time
      Parameters:
      time - the time value to be converted to generalized time string
      Returns:
      given time in generalized time string format
      See Also:
    • convertIntervalDate

      public static Date convertIntervalDate(String intervalDate) throws ParseException
      Converts the 18-digit Active Directory timestamps, also named 'Windows NT time format' or 'Win32 FILETIME or SYSTEMTIME'. These are used in Microsoft Active Directory for pwdLastSet, accountExpires, LastLogon, LastLogonTimestamp and LastPwdSet. The timestamp is the number of 100-nanoseconds intervals (1 nanosecond = one billionth of a second) since Jan 1, 1601 UTC.
      Parameters:
      intervalDate - 18-digit number. Time in 100-nanoseconds intervals since 1.1.1601
      Returns:
      The converted date
      Throws:
      ParseException - If the given interval is not valid