Discordian date: Difference between revisions
Content added Content deleted
Not a robot (talk | contribs) (Add MAD) |
m (→{{header|AppleScript}}: Tidied opening block comment.) |
||
Line 699: | Line 699: | ||
<lang applescript>on gregorianToDiscordian(inputDate) -- Input: AppleScript date object. |
<lang applescript>on gregorianToDiscordian(inputDate) -- Input: AppleScript date object. |
||
(* |
(* |
||
Discordian |
Discordian years are aligned with, and the same length as, Gregorian years. |
||
Each has 73 5-day weeks and 5 73-day seasons. (73 * 5 = 365.) |
|||
The first day of a Discordian year is also that of its first week and first season. |
|||
In leap years, an extra day called "St. Tib's Day" is inserted between days 59 and 60, the same slot as the Gregorian 29th February. It's considered to be outside the Discordian week and season, so the day after it is Setting Orange, Chaos 60, not Sweetmorn, Chaos 61. Discordian dates always correspond to particular Gregorian dates. |
|||
In leap years, an extra day called "St. Tib's Day", is inserted between days 59 and 60. |
|||
Year 1 YOLD is 1166 BC. |
|||
It's considered to be outside the calendar, so the day after it is Setting Orange, Chaos 60, |
|||
This handler is only guaranteed for AD Gregorian dates and it's the calling process's responsibility to convert any user text input from the user's format to an AS date object. |
|||
not Sweetmorn, Chaos 61. Year 1 YOLD is 1166 BC, but this handler takes an AS date object |
|||
as its input and is only good for AD Gregorian dates. Since the Discordian calendar's an |
|||
American invention, the output here's in the US style: "Weekday, Season day, year". |
|||
*) |
*) |
||
-- Calculate the input date's day-of-year number. |
-- Calculate the input date's day-of-year number. |
||
copy inputDate to startOfYear |
copy inputDate to startOfYear |
||
Line 741: | Line 742: | ||
end gregorianToDiscordian |
end gregorianToDiscordian |
||
set |
set ASDate to (current date) |
||
set |
set gregorianDate to ASDate's date string |
||
set discordianDate to gregorianToDiscordian(ASDate) |
set discordianDate to gregorianToDiscordian(ASDate) |
||
return {Gregorian:gregorianDate, Discordian:discordianDate}</lang> |
return {Gregorian:gregorianDate, Discordian:discordianDate}</lang> |
||
{{output}} |
{{output}} |
||
< |
<lang applescript>{Gregorian:"Saturday 5 December 2020", Discordian:"Prickle-Prickle, The Aftermath 47, 3186"}</lang> |
||
=={{header|AWK}}== |
=={{header|AWK}}== |