Package org.opends.server.schema
Class GeneralizedTimeSyntax
- java.lang.Object
-
- org.opends.server.schema.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 Summary
Constructors Constructor Description GeneralizedTimeSyntax()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteStringcreateGeneralizedTimeValue(long time)Retrieves an attribute value containing a generalized time representation of the provided date.static longdecodeGeneralizedTimeValue(ByteSequence value)Decodes the provided normalized value as a generalized time value and retrieves a timestamp containing its representation.static Stringformat(long t)Retrieves the generalized time representation of the provided date.static Stringformat(Date d)Retrieves the generalized time representation of the provided date.
-
-
-
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.
-
-