If there was a thread already, please do point me there for the query. Does the JavaScript Math Object support Long, type. While executing the proxy I see the following error:
var currentTime = Math.floor(+new Date()); // the current time in milliseconds
var issuedAtTimeSeconds = Long.valueOf(currentTime/1000);
Solved! Go to Solution.
Thanks @dchiesa1 , I used the Math round function to achieve this and was able to get the value rounded off, I do have one last question, I am trying this
var currentTimeStamp = context.getVariable("system.timestamp");
print("The current time is "+currentTimeStamp);
var issuedAtTime = Math.round(currentTimeStamp/1000);
print("The issued time is "+issuedAtTime);
var timeToExpire = 300;
var expirationTime = issuedAtTime+timeToExpire;
print("The expiration time is "+expirationTime);
var expTime = context.setVariable("expTime", context.getVariable("expirationTime"));
print("The exp time is "+expTime);
I printed the values to check if its getting values correctly to each variable, but the value for expTime is evaluating to undefined, I am seeing the GET to expirationTime is empty which I am sure is cause for the value of expTime to be showing as undefined, but am unable to figure out the issue. Please let me know if am missing out something, excerpt from the trace below:
The current time is 1719255765674 The issued time is 1719255766 The expiration time is 1719256066 The exp time is undefined
I intend to use the value of expTime downstream within the proxy, by referencing to this variable.
Thanks,
Debjit