Anonymous user
Discordian date: Difference between revisions
m
→{{header|REXX}}: added/changed whitespace and comments, added support for today's date.
(→{{header|REXX}}: </pre>) |
m (→{{header|REXX}}: added/changed whitespace and comments, added support for today's date.) |
||
Line 1,551:
=={{header|REXX}}==
<lang rexx>/*REXX program converts a mm/dd/yyyy Gregorian date
Dday.1= 'Sweetness' /*define the 1st day─of─Discordian─week*/
Dday.2= 'Boomtime' /* " " 2nd " " " " */
Dday.3= 'Pungenday' /* " " 3rd " " " " */
Dday.4= 'Prickle-Prickle' /* " " 4th " " " " */
Dday.5= 'Setting Orange' /* " " 5th " " " " */
▲seas.5='The Aftermath' /*define 5th season-of-Discordian-year.*/
▲gY=left(right(date(),4),4-length(Gy))gY /*adjust for a 2-dig yr or none*/
/*
doy=date('d',gY || right(gM,2,0)right(gD,2,0), "s") - (leapyear(gY) & gM>2)
dS=(doy-1)%73+1 /* " " season. */
say space(day.dW',' seas.dS dD gY+1166) /*show and tell Discordian date*/▼
/*────────────────────────────────────────────────────────────────────────────*/
return y//100\==0 | y//400==0 /*apply 100 and 400 year rule. */</lang>▼
leapyear: procedure; parse arg y /*obtain four-digit Gregorian year*/
if y//4\==0 then return 0 /*Not ÷ by 4? Not a leapyear.*/
'''output''' when using the (various) following inputs of:
<pre>
2/28/2012
|