Reputation: 11201
Following code does not work -
new Date(2011-10-01)
What is the format of specifying date literals in Groovy?
Upvotes: 1
Views: 592
Reputation: 160201
There's no concept of a "date literal" in either Groovy or Java.
See the Java Date API and/or the Groovy Date API.
If you want to create a date from a string, you need to parse it (or use DateFormat.parse()), or use Groovy-style dates.
Upvotes: 6