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

Ada version
m (addooRexx)
(Ada version)
Line 4:
<br>
Determine programatically and show on this page on what weekday Christmas Day, 2021 and New Year's Day, 2022 will fall or did fall.
 
=={{header|Ada}}==
<lang Ada>with Ada.Text_Io;
with Ada.Calendar.Formatting;
 
procedure Weekdays is
use Ada.Text_Io;
use Ada.Calendar.Formatting;
 
subtype Time is Ada.Calendar.Time;
 
procedure Info (Date : Time) is
begin
Put (Image (Date));
Put (" is a ");
Put (Day_Name'Image (Day_Of_Week (Date)));
Put (".");
New_Line;
end Info;
 
Christmas_Day : constant Time := Time_Of (Year => 2021, Month => 12, Day => 25);
New_Years_Day : constant Time := Time_Of (Year => 2022, Month => 01, Day => 01);
 
begin
Info (Christmas_Day);
Info (New_Years_Day);
end Weekdays;</lang>
{{out}}
<pre>
2021-12-25 00:00:00 is a SATURDAY.
2022-01-01 00:00:00 is a SATURDAY.
</pre>
 
=={{header|ALGOL W}}==
210

edits