Class GeneralizedTimeSyntax


  • public class GeneralizedTimeSyntax
    extends Object
    This class defines the generalized time attribute syntax, which is a way of representing time in a form like "YYYYMMDDhhmmssZ". The actual form is somewhat flexible, and may omit the minute and second information, or may include sub-second information. It may also replace "Z" with a time zone offset like "-0500" for representing values that are not in UTC.
    • Constructor Detail

      • GeneralizedTimeSyntax

        public GeneralizedTimeSyntax()
    • Method Detail

      • format

        public static String format​(Date d)
        Retrieves the generalized time representation of the provided date.
        Parameters:
        d - The date to retrieve in generalized time form.
        Returns:
        The generalized time representation of the provided date.
      • format

        public static String format​(long t)
        Retrieves the generalized time representation of the provided date.
        Parameters:
        t - The timestamp to retrieve in generalized time form.
        Returns:
        The generalized time representation of the provided date.
      • createGeneralizedTimeValue

        public static ByteString createGeneralizedTimeValue​(long time)
        Retrieves an attribute value containing a generalized time representation of the provided date.
        Parameters:
        time - The time for which to retrieve the generalized time value.
        Returns:
        The attribute value created from the date.
      • decodeGeneralizedTimeValue

        public static long decodeGeneralizedTimeValue​(ByteSequence value)
                                               throws DirectoryException
        Decodes the provided normalized value as a generalized time value and retrieves a timestamp containing its representation.
        Parameters:
        value - The normalized value to decode using the generalized time syntax.
        Returns:
        The timestamp created from the provided generalized time value.
        Throws:
        DirectoryException - If the provided value cannot be parsed as a valid generalized time string.