As part of create a Workflow to get the expiration date of an Active Directory username, I need to write a script to get current time in Unix timestamp format then convert it to LDAP timestamp (NT epoch)
1.Getting Current date in vRealize Orchestrator
Just create a work flow and put following codes:
var now = new Date()
var unixts = now.getTime() / 1000
System.log("Unix timestamp is: " + unixts)
If you just need Unix timestamp and need to round the number you can use in line 2 :
var unixts = Math.round(now.getTime() / 1000)
2.In this part we can write this code to convert Unix timestamp to LDAP timestamp
var ldaptimestamp = (unixts + 11644473600 ) * 10000000
System.log ("LDAP timestamp is: " + ldaptimestamp)
You can also use following link to verify the result: