{"id":11464,"date":"2026-01-07T17:43:32","date_gmt":"2026-01-07T17:43:32","guid":{"rendered":"https:\/\/myworldofit.net\/?p=11464"},"modified":"2026-01-07T17:43:32","modified_gmt":"2026-01-07T17:43:32","slug":"processing-active-directory-timestamps-in-node-red","status":"publish","type":"post","link":"https:\/\/myworldofit.net\/?p=11464","title":{"rendered":"Processing Active Directory timestamps in Node-RED"},"content":{"rendered":"<p>I recently had a need to process Active Directory timestamps in <a href=\"https:\/\/nodered.org\/\">Node-RED<\/a> (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 &#8216;the value is stored as a large integer that represents the number of 100-nanosecond intervals since January 1, 1601 (UTC)&#8217;. It&#8217;s used in a fair few fields (and in other places in Windows) including in:<\/p>\n<ul>\n<li>accountExpires<\/li>\n<li>pwdLastSet<\/li>\n<li>lastLogonTimestamp<\/li>\n<\/ul>\n<p>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.<\/p>\n<div class=\"oembed-gist\"><script src=\"https:\/\/gist.github.com\/jamesfed\/fdef543e58b36557125cfaf8d616f3d0.js\"><\/script><noscript>View the code on <a href=\"https:\/\/gist.github.com\/jamesfed\/fdef543e58b36557125cfaf8d616f3d0\">Gist<\/a>.<\/noscript><\/div>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;the value is stored as a large integer that represents the number of 100-nanosecond intervals since January 1,&#8230; <a class=\"read-more\" href=\"https:\/\/myworldofit.net\/?p=11464\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[20],"tags":[567,529],"series":[],"class_list":["post-11464","post","type-post","status-publish","format-standard","hentry","category-software","tag-javascript","tag-node-red"],"_links":{"self":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/11464","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11464"}],"version-history":[{"count":1,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/11464\/revisions"}],"predecessor-version":[{"id":11465,"href":"https:\/\/myworldofit.net\/index.php?rest_route=\/wp\/v2\/posts\/11464\/revisions\/11465"}],"wp:attachment":[{"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11464"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11464"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11464"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/myworldofit.net\/index.php?rest_route=%2Fwp%2Fv2%2Fseries&post=11464"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}