1

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.

Rao
  • 20,781
  • 11
  • 57
  • 77
dawit
  • 195
  • 1
  • 3
  • 15

1 Answers1

1

Do it like this:

myTimestamp = new Date().format("yyyy-MM-dd'T'HH:mm:ss.SSSZ" )
log.info "${myTimestamp}"
ou_ryperd
  • 2,037
  • 2
  • 18
  • 23