I recently had a need to process Active Directory timestamps in Node-RED (based on the output from LDAP) to work out if a specific action should be carried out on a user or not. Microsoft is a bit weird (Microsoft) here where ‘the value is stored as a large integer that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC)’. It’s used in a fair few fields (and in other places in Windows) including in:
- accountExpires
- pwdLastSet
- lastLogonTimestamp
Stack Overflow to the rescue with a comment that got me 99% of the way there, just needed to tweak the outputs as shown below with the code dropped into a function node.