Day of the week: Difference between revisions

Content added Content deleted
No edit summary
Line 728: Line 728:
</pre>
</pre>


=={{header|Tcl}}==
{{works with|Tcl|8.5}}
<lang tcl>package require Tcl 8.5

for {set y 2008} {$y <= 2121} {incr y} {
if {[clock format [clock scan "$y-12-25" -format {%Y-%m-%d}] -format %w] == 0} {
puts "xmas $y is a sunday"
}
}</lang>
outputs
<pre>xmas 2011 is a sunday
xmas 2016 is a sunday
xmas 2022 is a sunday
xmas 2033 is a sunday
xmas 2039 is a sunday
xmas 2044 is a sunday
xmas 2050 is a sunday
xmas 2061 is a sunday
xmas 2067 is a sunday
xmas 2072 is a sunday
xmas 2078 is a sunday
xmas 2089 is a sunday
xmas 2095 is a sunday
xmas 2101 is a sunday
xmas 2107 is a sunday
xmas 2112 is a sunday
xmas 2118 is a sunday</pre>
=={{header|UNIX Shell}}==
=={{header|UNIX Shell}}==
{{works with|bash}}
{{works with|bash}}