Passing today's date in soapui with specific format

641 views Asked by At

I want to pass today's date in this format 2020-12-07T20:15:15.783-06:00 by using this groovy script in soapui

${= new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ" )}

But I am getting the following error

Script48.groovy: 1: unexpected char: '' @ line 1, column 20. new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ" )```

Not sure what I am missing ? I want the date format to be matching the example.

1

There are 1 answers

0
ou_ryperd On

Do it like this:

myTimestamp = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
log.info "${myTimestamp}"