What happens here? Why an instance of Date
is created in this example:
String dataFormatada = new Date().format("dd/MM/yyyy")
In this example we did not use new
:
def data = Date.parse('dd/MM/yyyy', '31/12/1980')
When should I use new?