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 21:20, 12 January 2022
, 2 years agoAdd C
Not a robot (talk | contribs) (Add BCPL) |
Not a robot (talk | contribs) (Add C) |
||
Line 162:
<pre>12/25/2021 is a Saturday
1/1/2022 is a Saturday</pre>
=={{header|C}}==
<lang c>#define _XOPEN_SOURCE
#include <stdio.h>
#include <time.h>
int main() {
struct tm t[2];
strptime("2021-12-25", "%F", &t[0]);
strptime("2022-01-01", "%F", &t[1]);
for (int i=0; i<2; i++) {
char buf[32];
strftime(buf, 32, "%F is a %A", &t[i]);
puts(buf);
}
return 0;
}</lang>
{{out}}
<pre>2021-12-25 is a Saturday
2022-01-01 is a Saturday</pre>
=={{header|CLU}}==
|