I made a Python script that converts Gregorian dates to Symmetry454 ones!
from sbeak@sopuli.xyz to programming@programming.dev on 21 Mar 18:13
https://sopuli.xyz/post/42944754

If you didn’t know, Symmetry454 is a proposal for the reform of the Gregorian calendar made in 2002 that, as the name implies, has months that alternate between four and five weeks. It is perennial, meaning weekdays of dates don’t change (so you can reuse calendars as long as it’s not a leap year!) and certain holidays that depend on the nth weekday would have fixed dates (like Easter is proposed to be on the 7th of April). It interestingly has a leap week system that alternates between 5 and 6 year gaps between leap years, with an additional week being added to December during leap years. Personally, I find a leap week far more fun than a leap day.

I have made a small Python script that converts Gregorian dates into Symmetry454 dates, which follows the steps noted by the person who made Symmetry454 (they had a whole PDF and everything explaining each step to calculate all that, super helpful!). Currently, it accepts Gregorian dates (year, month, and day) and returns the Symmetry454 date (in YYYY-MM-DD format), as well as some additional information (like a basic calendar that shows the position of the day in the month. There is also a function for outputting a year, what quarter the day is in, and the fixed date since a defined epoch)

It doesn’t really do much at the moment, but in the future, I would like the program to be able to let the user explore the calendar of different Symmetry454 years, as well as easily interconvert the dates of the two systems. There are probably a bunch of bugs in my code, and it’s not really all that practical, but making it has been pretty fun!

If you want to check it out, it’s on Codeberg with the GPLv3 license: codeberg.org/sbird/py-symmetry454

The PDF found in this website detailing the calculations for converting from Gregorian to Symmetry454 was very helpful, here it is for reference: kalendis.free.nf/symmetry.htm (go all the way down to “Documentation”, it’s the PDF labelled “calendar arithmetic”)

No AI was used to create this project, all mistakes and bugginess are my own.

#programming

threaded - newest

TehPers@beehaw.org on 22 Mar 02:00 next collapse

This is neat! It might be useful to turn this into more of a CLI utility by having a mode for accepting some Gregorian date via stdin or CLI option, and outputting a parseable format for the Symmetry454 date via stdout. I’d recommend looking at the argparse module if you’re interested, though there are some third party packages that can make it even easier to parse program arguments.

g_blob@programming.dev on 22 Mar 05:45 next collapse

Totally agree. I would use it

sbeak@sopuli.xyz on 22 Mar 09:19 collapse

I will look at how to do something like that! That sounds really neat.

MonkderVierte@lemmy.zip on 22 Mar 11:49 collapse

No AI was used to create this project, all mistakes and bugginess are my own.

Only tangentially related but try to ask any LLM for the sunrise equation in Shell script and then do it by hand. You don’t need to first convert to caesarian date for this.

sbeak@sopuli.xyz on 22 Mar 12:00 collapse

I just followed the steps that the PDF on how to calculate it, and the document was very clear not to use shorthands or similar. Also, I don’t think I converted the dates to the Julian calendar form?

How it works, in a nutshell, is that it finds number of days since epoch (set to 1, first of Jan 1 CE/AD) and uses that number to find the Symmetry454 calendar date. If you want to know the specifics on how to do it, I would recommend looking at the PDFs given on their website!

MonkderVierte@lemmy.zip on 22 Mar 12:03 collapse

Ah no, this was just my experience with how stupidly overcomplex LLM’s solutions can be.

sbeak@sopuli.xyz on 22 Mar 12:30 collapse

Oh it was satire, that makes sense