Created
January 7, 2026 17:36
-
-
Save jamesfed/fdef543e58b36557125cfaf8d616f3d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //A Node-RED function (JavaScript) to work out the LDAP/FILETIME timestamp for now | |
| //With thanks to the resources below | |
| //https://stackoverflow.com/questions/73591039/node-red-js-calculate-time-elapsed | |
| //https://www.epochconverter.com/ldap | |
| var payload = "1601-01-01 00:00:00.000000+00:00"; | |
| var start_time = (new Date(payload)).getTime(); | |
| var d = new Date(); | |
| var end_time = d.getTime() | |
| var difference = end_time - start_time; | |
| msg.payload = difference + "0000" | |
| return msg; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment