Convert LDAP accountExpiry time


I am trying to convert a returned LDAP attribute accountExpiry to date.

131663448000000000 is the returned value.

Any advice?


This site might be a good starting point.

LDAP, Active Directory & Filetime Timestamp Converter

It has a converter and states how LDAP time stamps are defined.

def ntTime(t):
  from datetime import datetime,timedelta
  return datetime(1601,1,1) + timedelta(microseconds=t/10)
print ntTime(131663448000000000)
1 Like

Thanks Jordan, that worked.