Anonymous user
Day of the week: Difference between revisions
m
→using DATE iso: added/changed comments and whitespace.
m (→old school DOW: added/changed comments and blanks.) |
m (→using DATE iso: added/changed comments and whitespace.) |
||
Line 2,579:
Language note: the DATE built-in function always returns the day-of-week in English, no matter what the native language is in effect.
<lang rexx>/*REXX program displays in which years 12/25 (December 25th) falls on a Sunday. */
parse arg start finish . /*get the
if start==''
if finish=='' | finish=="," then finish=2121 /* "
do y=start to finish /*process all the years specified. */
if date('Weekday', y"-12-25", 'ISO')\=='Sunday' then iterate
/* if date('w' ,
/* ↑↑↑↑↑↑ ↑↑↑↑↑↑↑↑↑↑ ↑↑↑ */
/* option yyyy-mm-dd fmt */
say 'December 25th,' y "falls on a Sunday."
end /*y*/
/*stick a fork in it, we're all done. */</lang>
<pre>
December 25th, 2011 falls on a Sunday.
December 25th, 2016 falls on a Sunday.
|