CurrentTimestamp Function

 

CurrentTimestamp function return the current timestamp depending on the attribute type. for e.g if the attribute is of type Generalized Time it will return the timestamp in Generalized Time format, if the attribute is of type Nano 100 seconds it will return the timestamp in Nano 100 format etc.

 

Syntax:

CurrentTimestamp

CurrentTimestamp - (n) days

CurrentTimestamp - (n) months

CurrentTimestamp - (n) years

CurrentTimestamp - (n) hours

CurrentTimestamp - (n) minutes

CurrentTimestamp - (n) seconds

where n is the number, for e.g CurrentTimestamp -30 days

 

CurrentTimestamp supports both select and update statements.

 

Examples:

Select Statment Examples using CurrentTimestamp

 

Query

Search For

 SELECT FROM OU=Chicago,OU=US,DC=LDAPSoft where badPasswordTime >= CurrentTimestamp - 8 days
subtreescope

To find out all the entries entered a bad password in the last 8 days

SELECT FROM OU=Chicago,OU=US,DC=LDAPSoft where createTimeStamp >= CurrentTimestamp - 8 days
subtreescope

To find out all the entries created in the last 8 days

SELECT FROM OU=Chicago,OU=US,DC=LDAPSoft where objectCategory='Person' and objectClass='User' and lockoutTime<= CurrentTimestamp - 8 days and lockoutTime!=0 subtreescope

To find out all user entries with lockout time less then equal to 8 days

 

 

Update Statement Examples using CurrentTimestamp

Query

Results

 UPDATE cn=testuser4,ou=testusers,o=stooges set description= CurrentTimestamp -7 days
subtreescope

Update description atribute of cn=testuser4,ou=testusers,o=stooges with CurrentTimestamp -7 days, the attribute must be of type timestamp or you will get an error.

 

UPDATE ou=testusers,o=stooges set description= CurrentTimestamp -7 days
subtreescope

Update description attribute all entries in container ou=testusers,o=stooges with CurrentTimestamp -7 days, the attribute must be of type timestamp or you will get an error.

 

Related Links:

Current Start of Day Function

Current End of Day Function

Random Numbers Function

Random Alphabets Function

 


Ldapsoft Home page LDAP Admin Tool Home Page