LDAP (Active Directory) 18-Digit FILETIME timestamp conversion for accountExpires

    I couldn't find any open posts about converting the accountExpires field from the LDAP.

    Hopefully others searching in the future will stumble across this.

    This worked for me:

    if(left(accountExpires,11)/86400-109205 as [Expiry Date]


    Looks like 01/01/1601 (0) was the default min and 09/10/4523 (9223372036854775807) was the default max. Because I didn't want to show these values I ended up using:

    if(accountExpires=0 or accountExpires=9223372036854775807,'None',left(accountExpires,11)/86400-109205) as [Expiry Date]


    If you aren't sure how to get the LDAP data, see Rob Wunderlich's method in the below link.


    Qlikview Cookbook: Load Users and Groups from Active Directory http://qlikviewcookbook.com/recipes/download-info/load-users-and-groups-from-active-directory/