[Question]
  [
The solar year is 365 days, 5 hours, 48 minutes, 45 seconds, and 138 milliseconds, according to [this video](https://www.youtube.com/watch?v=qkt_wmRKYNQ). 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" -> "Friday"
"March 1, 2048"    -> "Sat"
(2100, 2, 29)      -> 0           # 0-indexed with Sunday as 0
"2100-02-29"       -> 7           # 1-indexed with Sunday as 7
"28 Feb. 2176"     -> "Wednesday"
"1-Mar-2176"       -> "Th"
"28/02/100000"     -> "F"         # DD/MM/YYYYYY
"Feb. 29, 100000"  -> 6           # 1-indexed with Sunday as 7
"03/01/100000"     -> 1          # MM/DD/YYYYYY and 1-indexed with Sunday as 1
```
Suggestions and feedback on the challenge are welcome. Good luck and good golfing!
  
[Answer]
# [C (gcc)](https://gcc.gnu.org/), 60 bytes
```
f(m,d,y){y-=m<3;return(y+y/4-y/128+"-bed=pen+mad."[m]+d)%7;}
```
[Try it online!](https://tio.run/##bY3BCoIwAIbP9RRjIGxsS51ChtmxW09QHeY2y8OGDD0M8dmXQSVRx//7@fgku0kZQoMMVdTj0bPK7LPS6X5wFnni45z5OOUFgazWquq0JUaoDTybK1E42pZTaG0PjGgtwmBcrzo37wbBo67dIJwHvKCAJ3kB2AFE7cVCChrE6YdjXC7WSTh5B@kfI6Nv/CUsmd38pknyk3nxpzWFBw "C (gcc) – Try It Online")
Simple modification of [Sakamoto's method](https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Sakamoto.27s_methods). Takes input as integer arguments in the order `month, day, year`, and outputs the number of the day (0-indexed on Sunday).
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~57~~ ~~55~~ 53 bytes
```
DayName@{m=#~Mod~128;6+Mod[(9#-m)/8-6Clip@m,28],##2}&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78H1CUmVcS/d8lsdIvMTfVoTrXVrnONz@lztDIwtpMG8iK1rBU1s3V1LfQNXPOySxwyNUxsojVUVY2qlX77@DgoFBdbWRgYqFjBBSu1VGAcIx1DMFsQwMDkIQlhGNuhlAF4kBVARUZQNQBpWA8kFxt7H8A "Wolfram Language (Mathematica) – Try It Online")
Takes three inputs: the year, the month, and the day, in that order. For example, if you save the above function as `fun`, then `fun[2048,2,28]` tells you the day of week of February 28, 2048.
## How it works
The formula `m=#~Mod~128;6+Mod[(9#-m)/8-6Clip@m,28]` converts the year into an equivalent year (a year with exactly the same days of week) between 6 AD and 33 AD. To do this, we subtract an offset and then take the year mod 28; but the offset changes every 128 years, and for years divisible by 128, we have to make a further adjustment because the equivalent year shouldn't be a leap year.
Anyway, once that's done, we look up the month and day in that equivalent year using the built-in `DayName`.
[Answer]
# [Python 2](https://docs.python.org/2/), 67 bytes
```
def f(m,d,y):y-=m<3;return(y+y/4-y/128+int("0032503514624"[m])+d)%7
```
[Try it online!](https://tio.run/##ZYo5DsMgEAD7vAJZssQKLC8LTsj1kigdRkkBsRAp9vXYLlKlmGZmFq6vT6bWwhxFlEkHzXDh4Z5u9lrm@i1ZsuLRDTwa8uqdq@wQLU1oJ@OO5LpHeoIK0J/aUvYcJWlBfgOdBzj8rNXC/Ml9PW8YRIC2Ag "Python 2 – Try It Online")
`int("..."[m])` can be replaced by `ord("-bed=pen+mad."[m])`.
[Answer]
# JavaScript, ~~65~~ 59 bytes
```
(d,m,y)=>(y-=m<3,(+"0032503514624"[m]+y+(y>>2)-(y>>7)+d)%7)
```
```
(d,m,y)=>(y-=m<3,(+"0032503514624"[m]+~~y+~~(y/4)-~~(y/128)+d)%7)
```
Uses Sakamoto's method. Gives `0=Sunday, 1=Monday, 2=Tuesday...`
*-2 bytes thanks to Misha Lavrov  
-4 bytes thanks to Arnauld*
[Answer]
# [Actually](https://github.com/Mego/Seriously), 37 bytes
This is a port of [notjagan's modification](https://codegolf.stackexchange.com/a/149600/47581) of [Sakamoto's algorithm](https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Sakamoto.27s_methods), but with a few stack-based tricks as described below. Input format is `day, year, month`. Output format is `0-indexed with Sunday as 0`. Golfing suggestions welcome! [Try it online!](https://tio.run/##S0wuKU3Myan8/99aycDA2MjUwNjU0MTMyETJNVPT2O7QRm3rQ3t8gBgI9/oc2ph9brG5g@r//0YWXEYGJkACAA "Actually – Try It Online")
```
;"0032503514624"Ei)3>±+;¼L;¼¼½L±kΣ7@%
```
**Explanation**
```
                     Implicit input: day, year, month (month is at TOS)
;"0032503514624"Ei)  Get the month code, convert to float, rotate to bottom of the stack
3>±+                 If 3>month, add -1 to year
;¼L                  Push floor(year/4) to stack
;¼¼½L±               Push floor(year/4) and append -floor(year/128) to stack.
kΣ                   Wrap the stack (y/128, y/4, y, month_code, d) in a list and sum
7@%                  Get the sum modulo 7
                     Implicit return
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~32~~ ~~31~~ ~~30~~ 28 bytes
Another port of [notjagan's modification](https://codegolf.stackexchange.com/a/149600/47581) of [Sakamoto's algorithm](https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Sakamoto.27s_methods) but with a base-250 number in place of `032503514624` (don't need the extra `0` because Jelly is 1-indexed). Input format is `month, year, day`. Output format is `0-based with Sunday as 0`. Golfing suggestion are very welcome as the way the links were tough to arrange and may still be golfable. [Try it online!](https://tio.run/##AUIAvf9qZWxsef//Mz5fQMK1w6bCuzcsMkkrwrXigJzhub7igbXhuKQ5e@KAmUTCs@G7iyvigbUrJTf///8y/zIwNDj/Mjg "Jelly – Try It Online")
**Edit:** -1 byte from using bit shift instead of integer division. -1 byte from rearranging the beginning and the input format. -2 bytes thanks to Erik the Outgolfer and caird coinheringaahing.
```
3>_@µæ»7,2I+µ“Ṿ⁵Ḥ9{’D³ị+⁵+%7
```
**Explanation**
```
         Three arguments: month, year, day
3>_@     Subtract (month<3) from year. Call it y.
µ        Start a new monadic chain.
æ»7,2    Bit shift y by both 7 and 2 (equivalent to integer division by 128 and by 4).
I+       y + y/4 - y/128
µ        Start a new monadic chain.
“Ṿ⁵Ḥ9{’  The number 732573514624 in base 250.
D        The list [7, 3, 2, 5, 7, 3, 5, 1, 4, 6, 2, 4].
³ị       Get the month code from the list (1-based indexing).
+⁵+      Add y, our month code, and day together.
%7       Modulus 7.
```
]