Dates & Times

This code can be copied and pasted into Groovy Script test step and executed. Use one at a time

new Date().format("yyyy-MM-dd")
Result Format will look like = “2012-04-23”

new Date().format("MMMM-dd-yyyy")
Result Format will look like = “April-23-2012”

new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
Result Format will look like = “2012-04-23T18:18:02-0400”

Log Output
To use log output – use the same code above but define it.

dat = new Date().format("MMMM-dd-yyyy")
log.info dat

Note: log.info will populate the result to the Log Output tab below