Active Directory timestamp converter
Turn the 18-digit numbers in lastLogonTimestamp, pwdLastSet and accountExpires into dates, and dates back into numbers. It also reads Unix times, whenCreated values and the negative intervals used by password and lockout policy.
Date to timestamp
How the numbers work
Active Directory stores most times as a Windows FILETIME: the count of 100-nanosecond intervals since 1 January 1601, 00:00 UTC. Divide by 10,000,000 to get seconds, then subtract 11,644,473,600 to get Unix time.
The same conversion on Windows, without this page:
[datetime]::FromFileTimeUtc(134394336000000000)
w32tm /ntte 134394336000000000
[datetime]::new(2026, 11, 18, 0, 0, 0, 'Utc').ToFileTimeUtc()
Which attribute uses which format
| Attribute | Format | Notes |
|---|---|---|
lastLogon | FILETIME | Not replicated. Each domain controller holds its own value, so the true last logon is the highest value across all of them. 0 means never. |
lastLogonTimestamp | FILETIME | Replicated, but only rewritten when the stored value is 9 to 14 days old. Good for finding stale accounts, not for the exact last logon. |
pwdLastSet | FILETIME | 0 means the user must change the password at the next logon. |
accountExpires | FILETIME | 0 and 9223372036854775807 both mean the account never expires. |
badPasswordTime | FILETIME | Not replicated, like lastLogon. |
lockoutTime | FILETIME | 0 means the account is not locked out. |
maxPwdAge, minPwdAge | Negative interval | A time span in 100-nanosecond units, stored as a negative number. -36288000000000 is 42 days. |
lockoutDuration, lockOutObservationWindow | Negative interval | -18000000000 is 30 minutes. |
whenCreated, whenChanged | Generalized time | Text in the form 20261118000000.0Z: year, month, day, hour, minute, second, in UTC. |
More Active Directory tools
-
Logon failure decoder
Read failed logon events 4625, 4771 and 4776: Status and Sub Status, Kerberos failure codes and logon types.
-
LDAP error decoder
Read an LDAP error from Active Directory: result code 49 and data 52e, 775, 773 or 532.
-
userAccountControl decoder
Read 512, 514, 66048 or any other userAccountControl value flag by flag, or tick flags to build one.
-
AD rights GUID lookup
Name the GUIDs in an ACL or event 4662: extended rights, property sets, classes and attributes.
-
groupType and sAMAccountType decoder
Turn -2147483646 or 805306368 into a group scope, a group type or an account type.
-
Kerberos encryption types decoder
Decode msDS-SupportedEncryptionTypes and ticket encryption types, and see where RC4 is still allowed.
-
SDDL and SID decoder
Read a security descriptor string in plain words and look up well-known SIDs.
-
GUID and SID converter
Turn an objectGUID or objectSid from base64, bytes or an immutableId into its GUID or S-1-5-21 form and back.
-
LDAP filter builder and explainer
Read an LDAP filter in plain words, with the bitwise and nested-group rules, or build one for common searches.