128 years? Hypothetical leap year reform The solar year is 365 days, 5 hours, 48 minutes, 45 seconds, and 138 milliseconds, according to this video. With the current Gregorian calendar, the rules for leap years are as follows:

if      year is divisible by 400, LEAP YEAR
else if year is divisible by 100, COMMON YEAR
else if year is divisible by 4,   LEAP YEAR
else,                             COMMON YEAR


Unfortunately, this method is off by one day every 3216 years.

One possible method of reforming the calendar is the following rule:

if      year is divisible by 128, COMMON YEAR
else if year is divisible by 4,   LEAP YEAR
else,                             COMMON YEAR


This has the benefit of not requiring us to change our calendars again for another 625,000 years, give or take.

Say the entire world decides that, starting now, we use this system of every fourth year is a leap year except every 128th year, changing our calendars as follows:

YEAR    GREGORIAN    128-YEAR
2044    LEAP         LEAP
2048    LEAP         COMMON
2052    LEAP         LEAP
 ...
2096    LEAP         LEAP
2100    COMMON       LEAP
2104    LEAP         LEAP
 ...
2296    LEAP         LEAP
2300    COMMON       LEAP
2304    LEAP         COMMON
2308    LEAP         LEAP


How would this affect our day of the week algorithms?

The challenge


Given a date from the year 2000 to the year 100000, find the day of the week under this new calendar.
Any input and output format is allowed as long as you clearly specify which formats you are using.
This is code golf so try to make your solutions as golfy as possible!


Test cases

"28 February 2048" -&gt; "Friday"
"March 1, 2048"    -&gt; "Sat"
(2100, 2, 29)      -&gt; 0           # 0-indexed with Sunday as 0
"2100-02-29"       -&gt; 7           # 1-indexed with Sunday as 7
"28 Feb. 2176"     -&gt; "Wednesday"
"1-Mar-2176"       -&gt; "Th"
"28/02/100000"     -&gt; "F"         # DD/MM/YYYYYY
"Feb. 29, 100000"  -&gt; 6           # 1-indexed with Sunday as 7
"03/01/100000"     -&gt; 1          # MM/DD/YYYYYY and 1-indexed with Sunday as 1


Suggestions and feedback on the challenge are welcome. Good luck and good golfing!
C (gcc), 60 bytes



f(m,d,y){y-=m&lt;3;return(y+y/4-y/128+"-bed=pen+mad."[m]+d)%7;}


Try it online!

Simple modification of Sakamoto's method. Takes input as integer arguments in the order month, day, year, and outputs the number of the day (0-indexed on Sunday).