# AD LDAP timestamp

**URL:** <https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273>\
**Category:** IIQ Discussion and Questions\
**Tags:** identityiq\
**Created:** [May 29, 2024, 11:43am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273 "2024-05-29T11:43:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![niket345](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@niket345](https://developer.sailpoint.com/discuss/u/niket345)\
**Post date:** [May 29, 2024, 11:43am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273/1 "2024-05-29T11:43:58Z")

</div>

### Which IIQ version are you inquiring about?

Version 8.4

### Share all details related to your problem, including any error messages you may have received.

Hello Experts,

I have noticed that WhenChanged attribute is in LDAP timestamp in AD link in IIQ. is there anyway to change that format to yyyy-mm-dd format in SailPoint.

whenChanged 20240522124922.0Z

Thanks

---

<div class="post-metadata">

**Author:** ![kjakubiak](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kjakubiak/32/7052_2.png) [@kjakubiak](https://developer.sailpoint.com/discuss/u/kjakubiak)\
**Post date:** [May 29, 2024, 11:47am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273/2 "2024-05-29T11:47:16Z")

</div>

Well, easiest way - CustomizationRule to convert value

Something like that

```auto
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Rule PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Rule language="beanshell" name="LDAPCustomization" type="ResourceObjectCustomization">
  <Source>
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

convertDateFormat(String dateStr) {
        // Define the input and output date formats
        DateTimeFormatter inputFormatter = DateTimeFormatter.ofPattern("yyyyMMddHHmmss.S'Z'");
        DateTimeFormatter outputFormatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        
        // Parse the input date string to a LocalDateTime object
        LocalDateTime dateTime = LocalDateTime.parse(dateStr, inputFormatter);
        
        // Format the LocalDateTime object to the desired format
        String formattedDate = dateTime.format(outputFormatter);
        
        return formattedDate;
    }

String unixDate = object.get("WhenChanged");
object.put("WhenChanged",convertDateFormat(unixDate));
return object;

</Source>
</Rule>

```

---

<div class="post-metadata">

**Author:** ![niket345](https://avatars.discourse-cdn.com/v4/letter/n/ba8739/32.png) [@niket345](https://developer.sailpoint.com/discuss/u/niket345)\
**Post date:** [May 29, 2024, 11:51am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273/3 "2024-05-29T11:51:42Z")

</div>

can we use this code for Identity Attribute also?

---

<div class="post-metadata">

**Author:** ![kjakubiak](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/kjakubiak/32/7052_2.png) [@kjakubiak](https://developer.sailpoint.com/discuss/u/kjakubiak)\
**Post date:** [May 29, 2024, 11:52am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273/4 "2024-05-29T11:52:17Z")

</div>

the date transform yes - but you have to put it into IdentityAttributeSource rule instead of CustomizationRule

EDIT:  
I’ve modified it a bit - as there was small bug there - now it should work fine.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 28, 2024, 11:52am UTC](https://developer.sailpoint.com/discuss/t/ad-ldap-timestamp/58273/5 "2024-07-28T11:52:46Z")

</div>

Closed on July 28, 2024, 11:52am UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
