com4j
com4j copied to clipboard
IADsUser.accountExpirationDate() uses wrong epoch time for date calculations
https://docs.microsoft.com/en-us/windows/win32/adschema/a-accountexpires
The date when the account expires. This value represents the number of 100-nanosecond intervals since January 1, 1601 (UTC). A value of 0 or 0x7FFFFFFFFFFFFFFF (9223372036854775807) indicates that the account never expires.
The com4j version is using 1900 instead of 1601 which throws off date calculations considerably.
Interestingly enough, upon further investigation, the date is somehow being parsed properly, but a timestamp of Mon Jan 01 00:00:00 GMT 1601 is equivalent to the value being 0 from the documentation.