15
The Discordian calendar is an alternative calendar used by Discordians.
- The discordian year has 5 seasons, each lasting 73 days: Chaos, Discord, Confusion, Bureaucracy, and The Aftermath.
- The discordian week has 5 days: Sweetmorn, Boomtime, Pungenday, Prickle-Prickle, and Setting Orange. Every year begins with Sweetmorn (and in Chaos).
- Every fourth year (which happens to align with Gregorian leap years), an extra day is inserted between Chaos 59 and Chaos 60 called St. Tib's Day. It is outside of the Discordian week, meaning the day after St. Tib's Day will be Setting Orange, the day before Prickle-Prickle.
- The Gregorian and Discordian calendars line up; both start on the same day, which is called January 1st in the Gregorian calendar, and Chaos 1 in the Discordian one.
- The first Year of Our Lady of Discord (YOLD 1) was 1166 BC in the Gregorian calendar, meaning this year (2017 AD) is YOLD 3183.
- The Discordian calendar also has holidays, but they are not important for this challenge and you should not output them or anything about them.
Write a program or function that outputs or returns today's date (at the time of execution):
Today is Boomtime, the 16th day of Confusion in the YOLD 3183
The format is "Today is $day_of_the_week, the $ordinal day of $season in the YOLD $year"
, where $day_of_the_week is the capitalized (title-case) day of the week, $ordinal is the day of the season as an ordinal (1st, 2nd, 3rd, 4th, ...), $season is the capitalized (title-case) season, and $year is the year.
If your program or function is executed on St. Tib's Day, it should instead output or return "Today is St. Tib's Day in the YOLD $year"
.
Rules:
- Standard loopholes apply.
- If your language of choice has no way of getting the current date, it may also take the current Gregorian date in any reasonable format as input.
- This is code-golf, the shortest code (per language) wins.
- Trailing whitespace is okay.
- Capitalization matters.
- Calling
ddate
in any way is banned - Your program should be guaranteed to work from 3067 to 3265 YOLD (1901 to 2099 AD), outside that range it can give incorrect values
See also:
- Malaclypse The Younger. "Principia Discordia, Or How I Found Goddess And What I Did To Her When I Found Her". p. 00034
- ddate(1)
- Sandbox post for those who can see it
4discord is a cool instant messaging client – Okx – 2017-06-11T08:14:22.490
I guess "St. Tib's Day" is not in Chaos either (i.e. the day-of-year mod 73 wont give the seasons accurately year-in-year-out)? – Jonathan Allan – 2017-06-11T08:30:23.287
@JonathanAllan Yes, St. Tib's Day is outside the seasons. – L3viathan – 2017-06-11T08:31:24.463
1I think today is 16th day of Confusion? What date does the example represent? – user202729 – 2017-06-11T08:36:12.203
2unrelated – Jonathan Allan – 2017-06-11T08:36:54.630
1@user202729 Yes, the date in the example is from when I originally wrote the challenge, I will update it to show today's date, which is indeed the 16th day of Confusion. – L3viathan – 2017-06-11T08:47:44.830
Was this sitting in the Sandbox for a while? If not, it may be a dupe; I've definitely seen this before. – Shaggy – 2017-06-11T09:21:02.787
@Shaggy It was in the Sandbox for about a month, and I looked for dupes but couldn't find any. – L3viathan – 2017-06-11T09:21:38.507
That explains it, so; I would have seen it in the Sandbox. – Shaggy – 2017-06-11T09:25:58.463
To be clear, as you require the current date, there is no need to handle gregorian years outside 1901 to 2099? The relevance of this is that turn of the century years such as 1900 and 2100 are not leap years, unless they are divisible by 400 (as 2000 was.) – Level River St – 2017-06-11T11:24:39.037
@LevelRiverSt Your code should be able to run on any date. The only exception I'm willing to make is that it doesn't need to run when your language's native date type (if any) overflows: For example, if your native date type (that you use) uses a signed 32-bit integer, then your program doesn't have to work after 18th of January 2038.
– L3viathan – 2017-06-11T11:27:31.4101
@L3viathan in that case (for those using a language with large native type) can you clarify a) how to handle turn of the century years that aren't leap years in the gregorian cal as "every 4th year" of the discordian cal contradicts with "aligns with the gregorian" b) how to handle years before introduction of the gregorian cal. I was suggesting the max range which is properly defined by your current spec. If you reject this, you should define what the program should do outside that range. Also you should avoid invalidating the existing answer. https://en.wikipedia.org/wiki/Gregorian_calendar
– Level River St – 2017-06-11T11:53:42.4501@LevelRiverSt The Principia is a bit unclear on that, but it fully aligns with the Gregorian calendar meaning the full leap-year rules apply. However, I don't want to invalidate the Mathematica answer (which appears to not take this into account), so I'll restrict the required range to 1901–2099.. – L3viathan – 2017-06-11T12:02:06.677
1Bash, 5 bytes:
ddate
. – Mark – 2017-06-11T18:37:17.780