How to get today's date in Groovy
Then use:
new Date().format( 'yyyyMMdd' )
The answer of @Opal did not work for me:
groovy.lang.MissingMethodException: No signature of method: java.util.Date.format() is applicable for argument types: (String) values: [yyyy-MM-dd]
Here is a solution that worked for me:
new java.text.SimpleDateFormat("yyyy-MM-dd").format(new Date())
(edit: removed extra parenth at the end of snippet)