Day of the week of Christmas and New Year: Difference between revisions

Line 140:
New Year's Day 2022 is on a Saturday
</pre>
 
=={{header|jq}}==
{{works with|jq}}
'''Works with gojq, the Go implementation of jq'''
 
Years, output format, and output are exactly as for [[#Wren|Wren]].
 
<lang jq>def weekdaynames:
["Sunday", "Monday","Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
 
# example: weekday(1999; 12; 25)
def weekday($year; $month; $day):
"\($year)-\($month)-\($day)" | strptime("%Y-%m-%d") | weekdaynames[.[-2]];
 
1578, 1590, 1642, 1957, 2020, 2021, 2022, 2242, 2245, 2393
| "In \(.), New year's day is on a \(weekday(.;1;1)), and Christmas day on \(weekday(.;12;25))."</lang>
{{out}}
As for [[#Wren]]
 
 
=={{header|Julia}}==
2,454

edits