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 start START and finish FINISH years. */
if start=='' then| start=2008="," then start=2008 /*NoneNot specified? AssumeThen use the default.*/
if finish=='' | finish=="," then finish=2121 /* " /*None specified? Assume default" " " " " */
 
do y=start to finish /*process all the years specified. */
 
if date('Weekday', y"-12-25", 'ISO')\=='Sunday' then iterate
 
/* if date('w' ,y"-12-25",'i' ) ··· (same as above). */
/* if date('w' , option yyyyy"-mm12-dd fmt 25", 'i' ) ··· (same as above). */
/* ↑↑↑↑↑↑ ↑↑↑↑↑↑↑↑↑↑ ↑↑↑ */
/* 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>
{{out}}'''output''' &nbsp; when using the default input:
<pre>
<pre style="height:15ex">
December 25th, 2011 falls on a Sunday.
December 25th, 2016 falls on a Sunday.