Day of the week: Difference between revisions

Ada solution added
(→‎{{header|UNIX Shell}}: should we instead say the version of the underlying glibc/libc?)
(Ada solution added)
Line 6:
Using any standard date handling libraries of your programming language; compare the dates calculated with the output of other languages to discover any anomalies in the handling of dates which may be due to, for example, overflow in types used to represent dates/times similar to [[wp:Y2k#See_also|y2k]] problems.
 
=={{header|Ada}}==
<ada>
with Ada.Calendar.Formatting; use Ada.Calendar.Formatting;
with Ada.Text_IO; use Ada.Text_IO;
 
procedure Yuletide is
begin
for Year in 2008..2099 loop
if Day_Of_Week (Time_Of (Year, 12, 25)) = Sunday then
Put_Line (Image (Time_Of (Year, 12, 25)));
end if;
end loop;
end Yuletide;
</ada>
Sample output:
<pre>
2011-12-25 00:00:00
2016-12-25 00:00:00
2022-12-25 00:00:00
2033-12-25 00:00:00
2039-12-25 00:00:00
2044-12-25 00:00:00
2050-12-25 00:00:00
2061-12-25 00:00:00
2067-12-25 00:00:00
2072-12-25 00:00:00
2078-12-25 00:00:00
2089-12-25 00:00:00
2095-12-25 00:00:00
</pre>
=={{header|Java}}==
<java>import java.util.Calendar;