I am trying to convert milliseconds (e.g : 1503478800000) to yyyy-MM-ddTHH:mm:ss.SSS'Z' (e.g : 2017-08-23T09:00:000Z) date-time format. Milliseconds value stored in the Soapui Global variable.
def testCase = messageExchange.modelItem.testCase;
def NewDateTime = testCase.testSuite.project.getPropertyValue("StartDateTime").toInteger();
log.info NewDateTime.setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
Error popup display :-
For input string: "1503478800000"
With Groovy you can do it with Date.format(String format)
method, e.g.
def millis = testCase.testSuite.project.getPropertyValue("StartDateTime").toLong()
log.info new Date(millis).format("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With