Long year: Difference between revisions
→{{header|REXX}}: refurbished
Not a robot (talk | contribs) (Add Cowgol) |
Walterpachl (talk | contribs) (→{{header|REXX}}: refurbished) |
||
Line 2,405:
=={{header|REXX}}==
<syntaxhighlight lang="rexx">/*REXX program determines
if LO=='' | LO=="," | LO=='*' then LO= left( date('S'), 4) /*Not given? Use default.*/▼
current=left(date('S'),4)
if HI=='' | HI=="," then HI= LO /* " " " " */▼
▲
if HI=='*' then HI= left( date('S'), 4) /*an asterisk ≡ current yr*/▼
Do
right(word('short long',is_long(yr)+1),5) ' year'
End
▲exit 0 /*stick a fork in it, we're all done. */
Exit
/*----------------------------------------------------------------------*/
wd_1231:
/*************************************************************************
* returns the day of the week of 31 December year
*************************************************************************/
Parse Arg year
Return (year+year%4-year%100+year%400)//7
is_long:
Parse Arg year
Return wd_1231(year)==4 |, /* year ends in a Thursday */
wd_1231(year-1)==3 /* or previous year ends in a Wednesday */</syntaxhighlight>
{{out|output|text= when using the inputs of: <tt> 1990 2030 </tt>}}
|