How to add seconds to timestamp in groovy script
Will would need to validate an opportunity keeping it editable for few seconds, then the sales stage changes into a particular value (after that the opportunity can not be editable anymore).
The script below works adding days, but it doesn't work for seconds (e.g. using decimal values instead of integer)
def curTime = now();
println("curTime: "+curTime.toString())
int daysModAllowed = 1;
def futureTime = curTime + daysModAllowed;
println("futureTime: "+futureTime.toString())
if(futureTime > curTime){
println("futureTime > curTime")
return true
}
return false
Below the Runtime Messages
curTime: 2025-02-02 15:48:17.463
futureTime: 2025-02-03 15:48:17.463
futureTime > curTime
is there a way to add 10 seconds to the current timestamp?