VaniV28
5 years agoOccasional Contributor
Error when using groovy script to tomorrow's date
Hi I'm using the following script to get tomorrow's date use(groovy.time.TimeCategory) { def tomorrow = new Date() + 1.day //log.info tomorrow.format('yyyy-MM-dd\'T\'HH:mm:ssZ') return tomorro...
- 5 years ago
VaniV28 :
You can use below code:
import groovy.time.TimeCategory import java.text.SimpleDateFormat use(TimeCategory) { date = (new Date())+1.day sdf = new SimpleDateFormat("yyyy-MM-dd\'T\'HH:mm:ssZ") newDate = sdf.format(date) log.info newDate }
for better understanding, you can refer below link
https://community.smartbear.com/t5/SoapUI-Pro/Ready-API-3-3-1-messed-date-up/td-p/205251