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

Add CLU
(Added 11l)
(Add CLU)
Line 108:
01 Jan 2022 is Saturday
</pre>
 
=={{header|CLU}}==
<lang clu>day_of_week = proc (d: date) returns (string)
own days: array[string] := array[string]$
[0:"Saturday", "Sunday", "Monday", "Tuesday",
"Wednesday", "Thursday", "Friday"]
m: int := d.month
y: int := d.year
if m <= 2 then
m := m + 12
y := y - 1
end
j: int := y/100
k: int := y//100
dn: int := (d.day + ((m+1)*26)/10 + k + k/4 + j/4 + 5*j)//7
return(days[dn])
end day_of_week
 
start_up = proc ()
po: stream := stream$primary_output()
days: array[date] := array[date]$
[date$create(25, 12, 2021, 0, 0, 0),
date$create( 1, 1, 2022, 0, 0, 0)]
for d: date in array[date]$elements(days) do
stream$putl(po, date$unparse_date(d) || " is a " || day_of_week(d))
end
end start_up</lang>
{{out}}
<pre>25 December 2021 is a Saturday
1 January 2022 is a Saturday</pre>
 
=={{header|F_Sharp|F#}}==
Line 118 ⟶ 150:
Christmas Day 2021 is a Saturday. New Years Day 2022 is a Saturday.
</pre>
 
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
2,114

edits