/code/ Challenge № III - Dokyun Calendar (6)

1 Name: #!/usr/bin/anonymous : 2021-01-25 02:38 ID:JgcWjPb2 This thread was merged from the former /code/ board. You can view the archive here.

I always enjoyed doing these back on /prog/. Here's the deal:

Dokyun Calendar
Input: one non-negative integer, corresponding to a certain number of days after September 1st, 1993 (inclusive).
Output: three non-negative integers, corresponding to the day, month, and year, in the calendar of your choice.

Rules
There are no damn rules, just make something cool!
Addendum: don't forget leap years.

Reward
The best submission, as determined by the hive mind, wins ten (10) Internet Cool Guy Points.

2 Name: #!/usr/bin/anonymous : 2021-02-14 18:03 ID:VRfdhI8j

Nice idea, but it feels almost wrong to have something like that. It breaks the magic, if you will. Something that goes the other way (takes a date in some format and outputs the September 1993 date) seems like a better idea.

3 Name: #!/usr/bin/anonymous : 2021-02-16 02:47 ID:JgcWjPb2

4 Name: Anonymous Techie : 2021-06-09 19:53 ID:L0p02Oeh

from datetime import date
from datetime import timedelta
def norm2dqn(year, month, day):
dqnday = date(1993, 8, 31)
norm = date(year, month, day)
return (norm - dqnday).days
def dqn2norm(day):
dqnday = date(1993, 8, 31)
norm = dqnday + timedelta(days=day)
return norm
print(norm2dqn(2021, 6, 9))
print(dqn2norm(10123))

5 Name: Anonymous Techie : 2021-07-06 22:27 ID:FcN312AV

>>4
Glad to see everyone likes my entry.
Do I win?

6 Name: Anonymous Techie : 2022-10-13 09:36 ID:Heaven

>>5 submissions remain open until 1994

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: