Day of the week of Christmas and New Year: Difference between revisions
Day of the week of Christmas and New Year (view source)
Revision as of 04:54, 27 November 2021
, 2 years agoadded AWK
(Added XPL0 example.) |
Catskill549 (talk | contribs) (added AWK) |
||
Line 5:
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|AWK}}==
<lang AWK>
# syntax: GAWK -f WHAT_WEEKDAYS_WILL_CHRISTMAS_AND_NEW_YEAR.AWK
BEGIN {
fmt = "%Y-%m-%d is a %A"
print(strftime(fmt,mktime("2021 12 25 0 0 0")))
print(strftime(fmt,mktime("2022 01 01 0 0 0")))
print("")
fmt = "%d %b %Y is %A"
print(strftime(fmt,mktime("2021 12 25 0 0 0")))
print(strftime(fmt,mktime("2022 01 01 0 0 0")))
exit(0)
}
</lang>
{{out}}
<pre>
2021-12-25 is a Saturday
2022-01-01 is a Saturday
25 Dec 2021 is Saturday
01 Jan 2022 is Saturday
</pre>
=={{header|Factor}}==
{{works with|Factor|0.99 2021-06-02}}
|