Skip to content

Instantly share code, notes, and snippets.

@jamesfed
Created January 7, 2026 17:36
Show Gist options
  • Select an option

  • Save jamesfed/fdef543e58b36557125cfaf8d616f3d0 to your computer and use it in GitHub Desktop.

Select an option

Save jamesfed/fdef543e58b36557125cfaf8d616f3d0 to your computer and use it in GitHub Desktop.
//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