I'm trying to compare a String with a date in it with the current date, but when I try to parse the string to date format it always give me an error.
the part of code that gives problem:
String data = "12-05-2020"
Date teste = Date.parse("dd-MM-yyy",data)
the error:
groovy.lang.MissingMethodException: No signature of method: static java.util.Date.parse() is applicable for argument types: (String, String) values: [dd-MM-yyy, 12-05-2020]
Possible solutions: parse(java.lang.String), wait(), clone(), grep(), any(), putAt(java.lang.String, java.lang.Object)
at Script1.run(Script1.groovy:2)
It seems to be something very silly, so, if you could help me! Thanks a lot