I am getting a date field from AD during explore/correlate process and placing the date in a internal attribute. However, the date is in the LDAP 18 character format that Microsoft uses. I found a piece of Javascript that does the conversion and attempted to use it in a BLTH for the task. When I use the task I am getting a function undefined message. Here is the BLTH:
function handleValidation(blthContext, errorMsg) {
imapi=Packages.com.netegrity.llsdk6.imapi
imsapi=Packages.com.netegrity.llsdk6.imsapi
user = blthContext.getUser();
var disable_date = user.getAttribute("imActivationDate");
function ldapToJS(n) {
// Longer, equivalent to short version
// return new Date(n/1e4 + new Date(Date.UTC(1601,0,1)).getTime());
// Shorter, more efficient. Uses time value for 1601-01-01 UTC
return new Date(n/1e4 - 1.16444736e13);
}
var ADS_Date = ldapToJS(disable_date).toISOString();
user.setAttribute("imExpirationDate",ADS_Date);
return true;
}
Any thoughts would be appreciated.