RSS

Category Archives: LDAP

Generalized and UTC time

There are different notations used to designate date and time-related information. For example, the fourth day of February in the year 1999 can be written as:

2/4/99

4/2/99

99/2/4

4.2.1999

04-FEB-1999

 

as well as many other notations.

 

Directory Server standardizes the timestamp representation by requiring the LDAP servers to support two syntaxes:

  • The Generalized Time syntax, which takes the form:

YYYYMMDDHHMMSS[.|,fraction][(+|-HHMM)|Z]

There are 4 digits for the year, 2 digits each for the month, day, hour, minute, and second, and an optional fraction of a second. Without any further additions, a date and time is assumed to be in a local time zone. To indicate that a time is measured in Coordinated Universal Time, append a capital letter Z to a time or a local time differential. For example:

19991106210627.3

which in local time is 6 minutes, 27.3 seconds after 9 p.m. on 6 November 1999.

19991106210627.3Z

which is the coordinated universal time.

19991106210627.3-0500

which is local time as in the first example, with a 5 hour difference in relation to the coordinated universal time.

 

If you designate an optional fraction of a second, a period or a comma is required. For local time differential, a ‘+’ or a ‘-‘ must precede the hour-minute value

  • The Universal time syntax, which takes the form:

YYMMDDHHMM[SS][(+ | -)HHMM)|Z]

There are 2 digits each for the year, month, day, hour, minute, and optional second fields. As in GeneralizedTime, an optional time differential can be specified. For example, if local time is a.m. on 2 January 1999 and the coordinated universal time is 12 noon on 2 January 1999, the value of UTCTime is either:

“9901021200Z”

     or

“9901020700-0500”

If the local time is a.m. on 2 January 2001 and the coordinated universal time is 12 noon on 2 January 2001, the value of UTCTime is either:

“0101021200Z”

     or

“0101020700-0500”

UTCTime allows only 2 digits for the year value, therefore the usage is not recommended.

 

The supported matching rules are generalizedTimeMatch for equality and generalizedTimeOrderingMatch for inequality. Substring search is not allowed. For example, the following filters are valid:

 generalized-timestamp-attribute=199910061030

 utc-timestamp-attribute>=991006

 generalized-timestamp-attribute=*

 

The following filters are not valid:

generalized-timestamp-attribute=1999*

utc-timestamp-attribute>=*1010

Advertisements
 
Leave a comment

Posted by on 07/05/2012 in LDAP