Looking for some help with Active Directory datetime format, specifically the attribute lastlogondatetimestamp.
According to google, The LastLogonTimeStamp attribute of the Active Directory stores the last logon timestamp value in the System.Int64 data type format. This timestamp is the number of 100-nanoseconds intervals since Jan 1, 1601, UTC.
How can I convert/evaluate this so that I can see if the lastlogondatetimestamp is more than 90 days? I'm not displaying the data anywhere, simply need to take action if the result is more than 90 days old to purge old user accounts from my application.
I tried this:
startDate = createdatetime( '1601','01','01','00','00','00' ); dateConvert( "utc2Local", dateadd( 's', arguments.lastlogondatetimestamp, startDate ) ); but my result ends up as:
{ts '124795117-01-18 18:00:18'} which tells me I did something incorrectly.
I also tried startDate = createdatetime( '1601','01','01','00','00','00' ); datetimeNow = dateConvert( "local2Utc", now() ); but when I dump datediff( 's', startdate, datetimeNow ); I am not clear on what to do with the value returned.
UPDATE I've since learned the dateconvert is not available in Lucee 5.