Day of the week: Difference between revisions

Line 298:
 
=={{header|Groovy}}==
checkFormat<lang groovy>def inFormat = new java.text.SimpleDateFormat("EEEyyyy-MM-dd")
<lang groovy>
inFormatdef checkFormat = new java.text.SimpleDateFormat("yyyy-MM-ddEEE")
checkFormat = new java.text.SimpleDateFormat("EEE")
 
def result = [](2008..2121).findAll {
(2008..2121).each {
Date date = inFormat.parse("${it}-12-25")
if (checkFormat.format(date) == "Sun") result.add it
}
 
printprintln result</lang>
</lang>
 
Output:
Anonymous user