Day of the week: Difference between revisions
Content added Content deleted
(→{{header|JavaScript}}: reduced noise in the output) |
|||
Line 1,423: | Line 1,423: | ||
=={{header|Ruby}}== |
=={{header|Ruby}}== |
||
<lang ruby>require 'date' |
<lang ruby>require 'date' |
||
SUNDAY = 0 |
|||
for year in 2008..2121 |
for year in 2008..2121 |
||
puts '25 Dec %d' % year if Date.new(year, 12, 25).wday == 0 |
|||
if day.wday == SUNDAY |
|||
puts '25 Dec %d' % year |
|||
end |
|||
end</lang> |
end</lang> |
||
Output: |
Output: |