
When Can I Reuse This Calendar? - sharkweek
https://www.whencanireusethiscalendar.com/
======
seandougall
If your old calendar includes holidays, you'd have to remember to ignore the
ones that are based on rules other than the Gregorian calendar (e.g. Easter
was April 21 this year but will be April 14 in 2047). Clearly those holidays
are just a conspiracy by Big Calendar to get us to buy more calendars.

Cool project otherwise!

------
DannyB2
The real benefit of this is that for the next hundred years or so, you can
continue to set your VHS Recorder's clock / calendar, which has only a two
digit year. Some of them display weak day calculated from the year. So always
setting the calendar year back by 28 years, for years after 2000 can extend
your VHS unit's life an extra century or so.

~~~
streb-lo
Wow great tip thanks.

------
mac01021
If only people would be less set in our ways, you could use the same calendar
every year:

[https://en.m.wikipedia.org/wiki/World_Calendar](https://en.m.wikipedia.org/wiki/World_Calendar)

~~~
tzakrajs
It seems most dissenters are people upset that the calendar is incongruent
with their favorite religious texts. If we change the calendar then we might
invalidate creation myth, oh noes!

~~~
tzakrajs
Upon second reading, I don't get it. There is still a saturday and a sunday
and the other 5 days we are used to.

------
jamiethompson
Hands up, who headed straight to ebay looking for old calendars?

~~~
zepolen
Why would you do that?

~~~
TheGrumpyBrit
Because using a 1992 calendar in 2020 would be pretty cool.

------
quickthrower2
Does it take Easter into account? When is the last year that has the same days
as 2019, and has the Easter(s) on the same days?

~~~
EADGBE
Just as a side note: here's an accepted official rule of Easter, which even
itself has some differentiation - in my opinion - the craziest (that I know)
rotating schedule ever:

 _Easter falls on the first Sunday after the Full Moon date, based on
mathematical calculations, that falls on or after March 21. If the Full Moon
is on a Sunday, Easter is celebrated on the following Sunday._

[https://www.timeanddate.com/calendar/determining-easter-
date...](https://www.timeanddate.com/calendar/determining-easter-date.html)

~~~
jedberg
> the craziest (that I know) rotating schedule ever

I'm guessing you aren't Jewish? Easter is based on the Jewish calendar, but
they didn't want to admit that, so they came up with these crazy rules based
on the Christian calendar to approximate the Jewish calendar. Easter is
supposed to be three days after passover, and in many years, it is, but every
few years they are way off and Easter is either a few weeks before or after
the Seder.

------
cardamomo
Yes! I love this! I once wrote a Python script for this same purpose. Thinking
about that problem really gave me much more familiarity with the ins and outs
of the Gregorian calendar.

~~~
Amorymeltzer
I did something similar with perl and my university's bus schedule. I find
those kind of simple, probably over-engineered projects where the time put in
probably isn't worth it[1] to be really useful ways for learning something
like times or dates far better than reading about it would.

At the very least it made sure I always knew how many days each month had!

1: [https://xkcd.com/1205/](https://xkcd.com/1205/)

~~~
jacobush
Thanks. It indicates I would probably gain from automating entering my time
sheets.

------
IvanK_net
So how many calendars do I need to buy, so that I don't need to buy any ever
again?

~~~
tarvaina
14? Seven for the years with leap days and seven for the years without.

~~~
elefantastisch
You could get away with 7 if you're willing to switch calendars in the middle
of the year. Buy one leap year calendar for each day of the week. If it's a
leap year, use as normal. If it's not, on March 1, just switch to the calendar
with the correct March 1 day.

~~~
madcaptenor
This would be a lot easier if the year ran from March 1 to February 28/29\.
Which it did, for the ancient Romans - so the additional day was at the end of
the year. This also explains why September through December come from roots
meaning 7 through 10, despite being the ninth through twelfth months.

------
vmurthy
Heh! Nice one :-) . I remember taking a competitive exam called CAT for
admission to MBA. CAT is notorious for being highly competitive and also has
some questions involving calendars. Some tricks and tips involving calendars
here - [https://www.hitbullseye.com/Quant/Modern-
Mathematics.php](https://www.hitbullseye.com/Quant/Modern-Mathematics.php)

------
navigaid
You can use this bash one-liner to enumerate all same-calendar-years of 2019
between 1900 and 2100.

    
    
      $ printf '%d\n' {1900..2100} | while read year; do printf "$year %s\n" $(cal $year | sed 1d | md5sum | cut -d ' ' -f 1) ; done | grep "$(cal 2019 | sed 1d | md5sum | cut -d ' ' -f 1)" | cut -d ' ' -f 1 | xargs
      1901 1907 1918 1929 1935 1946 1957 1963 1974 1985 1991 2002 2013 2019 2030 2041 2047 2058 2069 2075 2086 2097

------
ggm
Alas, I wrote in my diary with a pen. I will have to turn the pages 90 degrees
and write at right-angles. But having said that, I do keep calendars and
diaries. This could actually work for me. As a humour point. An obsessional
diary of the films I saw in London in 1985/6 would make a poignant backdrop to
my current diarizing of more humdrum daily existence in 20xx

~~~
gruez
>Alas, I wrote in my diary with a pen. I will have to turn the pages 90
degrees and write at right-angles

I don't get it. Please explain?

~~~
komali2
The OP might be using "diary" the way some people use "planner," a notebook
that comes hard-coded with days of week, date, and month written at the top of
a given page

i.e. [https://plannerpads.com/media/wysiwyg/2016-EXCD-Green-SB-
Spr...](https://plannerpads.com/media/wysiwyg/2016-EXCD-Green-SB-Spread.jpg)

Presumably this planner/diary has text in it that would be confusing to write
beneath. One's messages from 1983 or whatever would conflict with the ones
you're writing that are applicable to 2020.

If you turn it upside down, you know to only read text that's "right side up"
when the notebook is upside down.

I could be wrong.

~~~
ggm
You are almost right. By turning 90 degrees, I am writing ACROSS the old
words, not upside-down with respect to the old words. It becomes a cross-
hatch.

Writing across, is how in the old days, people used to reply to letters.
Didn't always work well for joined-up writing but worked well-enough.

The Diary was days-of-the-week. So, the same semantic intent as for a calendar
wired to a specific year. I need monday to be the "right" monday.

------
piyush_soni
Except all the Indian holidays would be on different dates :).

------
jedberg
I have some John Deere and Harley Davidson calendars that I got free in 2016.
Let me know if anyone wants them to hold on to until 2044.

------
unixhero
Would be great to see the source code of this. I think the logic used would be
fun to read.

~~~
mxtopher
I wouldn't be surprised if it was just a for loop checking for all the years
in a range, whether they start on the same day of week, and are/are not leap
years :)

~~~
jcranmer
The calculations are actually really easy. Note that the length of a (regular)
year is 1 mod 7, which means weekdays slip by 1 day each year, except for leap
years. Over the 400-year Gregorian calendar cycle, there are 97 leap years,
for a total of 497 days of slip... so adding 400 years to the current calendar
year will always yield the same calendar.

More specifically, there are 14 possible calendars. The leap year cycle is 4
days (excluding the 100 year skips), and the weekday cycle is 7 days, so the
leap year×weekday cycle is 28 years. So the starting weekdays are on a 28-year
cycle, but you have to slip your resulting calculation by the number of
centuries from the beginning of the 400-year cycle (i.e., integer division of
year by 100). You'll reuse a leap year calendar in 28 years (40 years, if it
crosses a round-hundred year), and you'll reuse a non-leap year calendar in 6
or 11 years (12 or 6 years, if it cross a round-hundred year).

The easiest way to code it is to just precompute the year % 400 table and
report the results.

~~~
ComputerGuru
> The leap year cycle is 4 days (excluding the 100 year skips)

I think you mean “The leap year cycle is 4 days (excluding the 100 year skips,
except every fourth 100 years when they don’t),” eg how 2000 _was_ a leap year
despite this individual rule.

(I know it’s accounted for elsewhere in the modulo logic, but you shouldn’t
resist the impulse to point out just how crazy it all is!)

~~~
jcranmer
The 400 year rule is already accounted for by taking the year mod 400. 2000,
2400, 2800, etc. will all use the same calendar.

~~~
ComputerGuru
Yes, I did mention you had it taken care of, just not explicitly pointed out
:)

------
gpvos
Love the FAQ about lunar cycles.

~~~
fireattack
What's the deal with that URL that links to "pageok"? Just a dead website or
deeper joke?

~~~
gpvos
I'm guessing just a dead website.

------
tzs
Ignoring leap years, the pattern within a century [1] is that the calendar for
year Y, where Y is the 2-digit year, can next be reused in:

Y+6 if Y is of the form 4N or 4N+1

Y+11 if Y is of the form 4N+2

Y+5 if Y is of the form 4N+3

If you start at a 4N year, this takes you to a 4N+2 year, then 4N+1 year, then
a 4N+3 year, and then back to a 4N year, so you'll step through the century in
steps of 6, 11, 6, 5, and repeat.

So, for 2019, 19 = 4x4+3, and we at at the add 5 stage of that 6, 11, 6, 5
pattern, and so (ignoring leap years) we get the same calendar in 2019+5 =
2024, 2024+6 = 2030, 2030+11 = 2041, 2041+6 = 2047, 2047+5 = 2052, 2052+6 =
2058, 2058+11 = 2069, 2069+6 = 2075, 2075+5 = 2080, 2080+6 = 2086, and 2080+11
= 2097.

Now it is time to stop ignoring leap year. 2019 is not a leap year, so strike
from that list any leap years, leaving 2030, 2041, 2047, 2058, 2069, 2075,
2086, and 2097.

Note you can also go backward. 2019-6 = 2013, 2013-11 = 2002.

Another way to do this, perhaps simpler, is to note that two 2-digit years, Y1
and Y2, in the same century have the same calendar (ignoring leap years) if Y1
+ Y1//4 == Y2 + Y2//4 mod 7.

The smallest year for which Y + Y//4 == K mod 7, for K=0,1,2...,6 is: 0, 1, 2,
3, 9, 4, 5.

So, back to 2019. 19 + 19//4 == 2 mod 7, which we see from the prior paragraph
first occurs in 2002. That's a 4N+2, so we start the 6, 11, 6, 5 pattern at
11. Get the next three years that match 2002 from that pattern: 2013, 2019,
2024.

You could continue the cycle from there to finish off the century, buy perhaps
easier is to note that the whole pattern of calendars and leap years repeats
every 28 years.

28 years added to 2002, 2013, 2019, 2024 gives 2030, 2041, 2047, and 2052.
Another 28 years gives 2058, 2069, 2075, and 2080. Next is 2086 and 2097.

Let's bust out of our confinement to the current century. Century C has the
same calendars as century C+4, so our 2019 calendar will work in 2402, 2413,
2419, and so on.

Using 2000 as the base, whenever we cross a century boundary within the
current 400 century span, it is like adding 5 to the Y + Y//4 value.

For 2019 we were using 19 + 19//4 == 2 mod 7 for our target. When we cross
into the 2100s we pick up 5, and so need to subtract 5 from that 2 to
compensate. Remember, we do all that mod 7, and the result is 4. In the 2100
century, then, we are looking for years with Y + Y//4 == 4 mod 7. As we saw 6
paragraphs back, 2109 would be the first such year.

2109 is a 4N+1 year, which puts us at the second 6 in the 6, 11, 6, 5 pattern,
giving us 2115, 2120, 2126 as the other matching years in the first 28. Repeat
those every 28 to fill with the 2100s.

Don't forget to delete the leap years!

Note: the calendars for the leap years are only off during January and
February. You can go ahead and use, for example, the 2019 calendar in 2024 for
March through December.

[1] for our purposes, century == fullyear//100, in Python 3. E.g., the current
century is [2000, 2099].

~~~
I_complete_me
This reminds me of the efforts I made to answer the following question from a
Soviet puzzle book I happened upon."Does New Year's Day fall more often on a
Sunday or a Saturday?". I will leave the working out of the answer to the
curious.

------
dvdbloc
Someone needs to send this to Kavanaugh

~~~
gpvos
Who?

~~~
wongarsu
I guess we are talking about the newest justice of the US Supreme Court. His
nomination was controversial because of multiple sexual assault allegations
and his overall questionable character. I don't really get the connection to
calendars though.

~~~
Amorymeltzer
Part of the "evidence" from his lawyers was Kavanaugh's high school calendar
over the summer in question (1982):
[https://www.pbs.org/newshour/politics/see-four-months-of-
bre...](https://www.pbs.org/newshour/politics/see-four-months-of-brett-
kavanaughs-calendar-from-1982)

Supporters said it showed no party, which was where the assault occurred.
Detractors said it didn't prove a negative and that numerous events were
suspicious. Everybody was shocked that someone would keep a high school
calendar for 35 years.

This is all offtopic but per the site, a 1982 calendar would next be reusable
in 2021, 2027, and 2038.

