Sandyapitester
8 years agoFrequent Contributor
How to create datetime string in soapui using groovy with +10 days or -10 days
Hi All,
Am able to get the current time using groovy but need the timestamp 10days and after days format
Groovy scripting:
today = new Date()-10 .format("yyyy-MM-dd HH:mm:ss.SSSSS Z")
log.info today
but need the timestamp + 10 days and after 10 days format
Please share the solution and suggestion
Here are some cool examples of how to play with Date objects using Groovy
https://examples.javacodegeeks.com/jvm-languages/groovy/groovy-date-example/
From examples in the link sanj suggested
new Date().plus(2).format('yyyy-MM-dd')
new Date().minus(2).format('yyyy-MM-dd')