Discordian date: Difference between revisions
Content added Content deleted
(→Icon and Unicon: and clearly the Discordians had something to say about the end of the Mayan Calendar!) |
(J: bug fix (missing require'dates') and additional examples and comments) |
||
Line 707: | Line 707: | ||
=={{header|J}}== |
=={{header|J}}== |
||
<lang j>require'dates' |
|||
leap=: _1j1 * 0 -/@:= 4 100 400 |/ {.@] |
|||
bs=: ((#:{.) + 0 j. *@[ * {:@]) +. |
bs=: ((#:{.) + 0 j. *@[ * {:@]) +. |
||
disc=: ((1+0 73 bs[ +^:(58<]) -/@todayno@(,: 1 1,~{.)@]) ,~1166+{.@])~ leap</lang> |
disc=: ((1+0 73 bs[ +^:(58<]) -/@todayno@(,: 1 1,~{.)@]) ,~1166+{.@])~ leap</lang> |
||
Line 714: | Line 715: | ||
<lang> disc 2012 2 29 |
<lang> disc 2012 2 29 |
||
3178 1 59j1 |
3178 1 59j1 |
||
disc 2012 3 1 |
|||
3178 1 60j1 |
|||
disc 2012 12 31 |
|||
3178 5 73j1 |
|||
disc 2013 1 1 |
|||
3179 1 1</lang> |
|||
see [[Talk:Discordian_date|talk page]]. But, in essence, this version uses season ordinals with a single imaginary day after the 59th of the first season, on leap years. This is implemented so that that imaginary day has been passed for all remaining days of a leap year. |
|||
see [[Talk:Discordian_date|talk page]]. |
|||
=={{header|JavaScript}}== |
=={{header|JavaScript}}== |