[Question]
  [
This challenge, I hope, is simple to understand. Given a date-string (given in any format you prefer, **so long as it has 4 digits of year and 2 digits of day and month**), calculate the weekday for the particular date-string. You must output 7 different values, corresponding to the weekday you have calculated.
It's okay if your program only theoretically (given enough time and memory) prints the correct weekday, as long as it can calculate for years between 2000 and 2002.
If you're using a built-in, consider adding a non-built-in approach as well. Built-in solutions won't be considered for being accepted.
Make sure to account for leap years!
## Test cases
Input format is `DD/MM/YYYY`, output is one of `Su, Mo, Tu, We, Th, Fr, Sa` (both can be adjusted for your choice)
```
Input -> Output
12/11/2001 -> Mo
29/02/2000 -> Tu
04/07/2002 -> Th
11/08/2000 -> Fr
```
This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest answer wins!
**EDIT**:
When I said "No built-ins", I meant that *built-ins that automatically calculate the weekday for a particular date* were *discouraged*, not prohibited. If the built-in aids in finding the weekday, no problem, but if it directly calculates the weekday then I *discourage* it.
  
[Answer]
# Excel (ms365), 12 bytes
```
=WEEKDAY(A1)
```
Outputs numbers [1-7] where Sunday == 1;
[![![enter image description here](https://i.stack.imgur.com/sX5uq.png)](https://i.stack.imgur.com/sX5uq.png)
---
# Excel (ms365), 14 bytes
```
=WEEKDAY(A1,2)
```
Outputs numbers [1-7] where Monday == 1:
[![enter image description here](https://i.stack.imgur.com/QxL4y.png)](https://i.stack.imgur.com/QxL4y.png)
---
# Excel (ms365), 15 bytes
```
=TEXT(A1,"ddd")
```
Outputs lowercase text [mo-su]:
[![enter image description here](https://i.stack.imgur.com/i8es3.png)](https://i.stack.imgur.com/i8es3.png)
---
# Excel (ms365), 23 bytes
```
=PROPER(TEXT(A1,"ddd"))
```
Outputs text [Mo-Su] capitalizing the first letter:
[![enter image description here](https://i.stack.imgur.com/nZsmM.png)](https://i.stack.imgur.com/nZsmM.png)
---
**Note:** Excel will recognize the date-strings as actual dates. Therefor having date-strings and date-numbers would have the same effect.
[Answer]
# [R](https://www.r-project.org/), ~~31~~ 30 bytes
*Edit: doesn't beat [Robin Ryder's answer](https://codegolf.stackexchange.com/a/252639/95126) but at least (currently) ties it*
```
function(s)el(as.Date(s):1)%%7
```
[Try it online!](https://tio.run/##K/qfklhp@z@tNC@5JDM/T6NYMzVHI7FYzyWxJBXIsTLUVFU1B6nRUDIyMDLSNTTQNTBV0vwPAA "R ‚Äì Try It Online")
Semi built-in solution. Thursday is `0`, and then cycles through `1`-`6`.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~36~~ ~~24~~ ~~22~~ ~~21~~ 19 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
4√ñ2‚ÄöI3@√®¬≥¬π¬≤23*9√∑√Ü7%
```
-12 bytes thanks to *@DominicVanEssen* (and *@Neil*) for reminding me that the challenge years are guaranteed to be 2000-2002  
-2 bytes porting [*@Arnauld*'s JavaScript (top) answer](https://codegolf.stackexchange.com/a/252703/52210), so make sure to upvote him as well!  
-1 byte thanks to *@DominicVanEssen* again in *@Arnauld*'s port  
-2 bytes taking three loose inputs instead of a triplet
Three loose input-integers in the order `yyyy,MM,dd`; output is an integer where `6` = Sunday, `5` = Monday, ..., `0` = Saturday.
[Try it online](https://tio.run/##yy9OTMpM/f/f5PA0o0cNszyNHQ6vOLT50M5Dm4yMtSwPbz/cZq76/7@RgYEhlyEQGQEA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfWVQQmjYoZX/TQ5PM3rUMCvS2OHwiohD6yKNjLUsD28/3Gau@t/F/lHD3KOTDvceXXBoPZCeDcSrjk46tPNRw86je4HE4clABcrFh1coKWgc3q@ppPM/OtrQSMfQUMfIwMAwVifayFLHwAjEMQByDEx0DMxBHCMgB6jGwAIuA@QYwjlGyBxjZI4JMscUmWOGzDGHc2IB).
**Explanation:**
```
4√ñ       # Check if the (implicit) first input-year is divisible by 4
  2‚Äö     # Pair this 0 or 1 with 2
    I    # Push the second input-month
     3@  # Check if it's >=3
       √® # Use that to index into the pair
¬≥        # Push the third input-day
 ¬π       # Push the first input-year
  ¬≤      # Push the second input-month
   23*   # Multiply the month by 23
      9√∑ # Integer-divided by 9
√Ü        # Reduce the entire stack by subtracting:
         #  [m%4<1,2][m>=3]-d-y-m*23//9
 7%      # Modulo-7, resulting in 6 to 0 for Sunday to Saturday
```
---
**Original ~~36~~ 24 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage) answer:**
```
`UD3‚Äπ¬©12*+>‚ÇÇ*T√∑¬ÆXŒ±D4√∑O7%
```
[Try it online](https://tio.run/##ATcAyP9vc2FiaWX//2BVRDPigLnCqTEyKis@4oKCKlTDt8KuWM6xRDTDt083Jf//WzEyLDExLDIwMDFd) or [verify all test cases](https://tio.run/##yy9OTMpM/V9Waa@k8KhtkoKSfeX/hFAX40cNOw@tNDTS0rZ71NSkFXJ4@6F1Eec2upgc3u5vrvrfxf5Rw9yjCw6tPzrpcC9Q6eHJQOLo3qOTDu0EiqwC4tlABcrFh1coKWgc3q@ppPM/OtrQSMfQUMfIwMAwVifayFLHwAjEMQByDEx0DMxBHCMgB6jGwAIuA@QYwjlGyBxjZI4JMscUmWOGzDGHc2IB).
**Explanation:**
05AB1E lacks any date builtins (except for the current year/month/day/etc.), so everything is done manually using [Zeller's congruence](https://en.wikipedia.org/wiki/Zeller%27s_congruence), taken from [this earlier 05AB1E answer of mine](https://codegolf.stackexchange.com/a/173126/52210):
The formula to do this is:
$${\displaystyle h=\left(q+\left\lfloor{\frac{13(m+1)}{5}}\right\rfloor+K+\left\lfloor{\frac{K}{4}}\right\rfloor+\left\lfloor{\frac{J}{4}}\right\rfloor-2J\right){\bmod{7}}}$$
Where for the months March through December:
* \$q\$ is the \$day\$ of the month (`[1, 31]`)
* \$m\$ is the 1-indexed \$month\$ (`[3, 12]`)
* \$K\$ is the year of the century (\$year \bmod 100\$)
* \$J\$ is the 0-indexed century (\$\left\lfloor {\frac {year}{100}}\right\rfloor\$)
And for the months January and February:
* \$q\$ is the \$day\$ of the month (`[1, 31]`)
* \$m\$ is the 1-indexed \$month + 12\$ (`[13, 14]`)
* \$K\$ is the year of the century for the previous year (\$(year - 1) \bmod 100\$)
* \$J\$ is the 0-indexed century for the previous year (\$\left\lfloor {\frac {year-1}{100}}\right\rfloor\$)
Resulting in the day of the week \$h\$, where 0 = Saturday, 1 = Sunday, ..., 6 = Friday.
But, since the challenge states the year is guaranteed to be 2000-2002, we can simplify the formula to this instead:
$${\displaystyle h=\left(q+\left\lfloor{\frac{13(m+1)}{5}}\right\rfloor+K+\left\lfloor{\frac{K}{4}}\right\rfloor\right){\bmod{7}}}$$
Resulting in the day of the week \$h\$, where 0 = Friday, 1 = Saturday, ..., 6 = Thursday.
As for the actual program:
```
`           # Push the day, month, and year of the (implicit) input-triplet to the stack
 U          # Pop and save the year in variable `X`
  D         # Duplicate the month
   3‚Äπ       # Check if the month is below 3 (Jan. / Feb.),
            # resulting in 1 or 0 for truthy/falsey respectively
     ¬©      # Store this in variable `¬Æ` (without popping)
      12*   # Multiply it by 12 (either 0 or 12)
         +  # And add it to the month
            # This first part was to make Jan. / Feb. 13 and 14
>           # Month + 1
 ‚ÇÇ*         # Multiplied by 26
   T√∑       # Integer-divided by 10
¬Æ           # Push month<3 from variable `¬Æ` again
 XŒ±         # Take the absolute difference with the year
D4√∑         # mYear, integer-divided by 4
O           # Sum all values on the stack together
 7%         # And then take modulo-7 to complete the formula,
            # resulting in 0 to 6 for Friday to Thursday
            # (which is output implicitly as result)
```
[Answer]
# [R](https://www.r-project.org/), ~~30~~ 27 bytes
-3 bytes thanks to naffetS
```
function(s)strftime(s,"%A")
```
[Try it online!](https://tio.run/##K/qfklhp@z@tNC@5JDM/T6NYs7ikKK0kMzdVo1hHSdVRSROkQEPJyMDISNfQQNfAFCgCAA "R ‚Äì Try It Online")
3 bytes shorter than the [alternate R solution](https://codegolf.stackexchange.com/a/252630/86301).
The natural solution would be to use `format(as.Date(s), "%A")`, which converts `s` to the `Date` class then displays only the weekday. Luckily, the `strftime` is a wrapper for this, saving a few bytes.
[Answer]
# [Red](http://www.red-lang.org), 13 bytes
```
func[d][d/10]
```
[Try it online!](https://tio.run/##K0pN@R@UmhIdy8WVZvU/rTQvOTolNjpF39Ag9n9aflFqYnKGQkpiSapCNJcCEBgZGBjqGgKREYxroGtgpGtkCeMa6RqY6xqYIMlaANVzxUYXFGXmlSikgQ2L5fwPAA "Red ‚Äì Try It Online")
Returns `1` to `7`, Monday is 1
# [Red](http://www.red-lang.org), 46 bytes
```
func[d][take/part system/locale/days/(d/10) 2]
```
[Try it online!](https://tio.run/##TYw7CsMwEETr6BRbJoXQagnkcwy3QsWiXZEQxzaSUvj0igkYMkzzeMMUlT6ohGhMvvf8mVKQGBq/1C1cGtS1Nn27cU48qhNeqzuK83gCij3PRTk9QLgpBANbCNFbv5V2RItk6bYjWbxYPP/Z67Y3MSzlOTXIv7N46F8 "Red ‚Äì Try It Online")
Returns `Mo Tu We Th Fr Sa Su`
[Red](http://www.red-lang.org)'s `date!` datatype has `weekday` accessor that is also aliased by index 10. So for a date `d` we can write `d/weekday` or shorter `d/10`
[Answer]
# JavaScript (ES6), 38 bytes
This is an attempt at solving the challenge without a built-in, using a formula optimized for 2000-2002.
Expects `(year, month, day)`. Returns \$0\$ for Sunday, \$1\$ for Monday, ..., \$6\$ for Saturday.
```
(y,m,d)=>~((m<3?y%4<1:2)-d-y-23*m/9)%7
```
[Try it online!](https://tio.run/##TY4xTsQwEEV7TjHNKjZxgpNFWu1uwjaIAgkoUlFasROM4njlGFCE4ARINJRwD86zF9gjhEloIo1Go//mz59H8Sy60um9j1or1VDlA@mZYZLmF@@EmGy56xfnWbJJaSSjPkqXp@ZsTRerobKOaMgh2YKGDBK@XuEUhhReTwCk8Aphq17gEkeScs4ZYGm6RdwjG1fiWvmrp6a5V8KRiZgZubGtfyAUQgwZb87QdHQyONWhXuHXYBhI1FAsbdvZRsWNrclk8fa6uLslNO4aXSrCWcIpG71ICu90WyPbC1l44TxJ/xnk88AeP9lBcPz9PHx/YQ9gA8Hh5yPAyLfhDw "JavaScript (Node.js) ‚Äì Try It Online")
### Commented
This is based on the following C code by Michael Keith and Tom Craver:
```
(d+=m<3?y--:y-2,23*m/9+d+4+y/4-y/100+y/400)%7
```
[Wikipedia article](https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Keith)
```
(y, m, d) =>    // y = year, m = month, d = day
~(              // take the ones' complement of:
  (             //   conditional offset:
    m < 3 ?     //     if this is January or February:
      y % 4 < 1 //       use 1 if this is 2000
                //       (which is a leap year)
                //       or 0 otherwise
    :           //     else:
      2         //       use 2
  )             //
  - d           //   subtract the non-conditional offset:
  - y           //     d + y + 23 * m / 9
  - 23 * m / 9  //
) % 7           // apply modulo 7
```
[Answer]
# [Bash](https://www.gnu.org/software/bash/), ~~14~~ 13 bytes
```
date -d$1 +%u
```
[Try it online!](https://tio.run/##VU7vaoMwEP/uUxxZBhEJxNCxFpdt0O0ptB9cctKwocWkIIjP7k7bdVtICL@/dx91OM7NubXRdy00IoVxdnVEkI7nkN2f5ylxaL/qnqgaIoZoBNNK5TKnqxksQEmlpd5dgJbqUarNTdmSk6V/W3A4oY3ojMhBwwYe/qn2iPYTexpTDe@6GnZ7ekvdFb5Vw3ZPhU3XgxDgjSrAPzE@3v30lq@HiRWQZT5NC9clQCcacizrl9yTunK4cLfQLx8MFw0wHmnKmqUYwcDAGPrx4jr1vo2rDeQz8AB8vK5e8pfDVLUscV2L8zc "Bash ‚Äì Try It Online")
*Saved a byte thanks to [Steffan](https://codegolf.stackexchange.com/users/92689/steffan)!!!*
Inputs the date as `YYYY-MM-DD` and returns \$1\$ for Monday, \$2\$ for Tuesday, up to \$7\$ for Sunday.
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~16~~ 6 bytes
Takes datetime object as input, [per OP](https://codegolf.stackexchange.com/questions/252621/which-weekday-was-it/252685#comment562259_252621).
Takes date as `YYYY-MM-DD` and returns 0‚Äì6 for Thursday‚ÄìWednesday.
```
d=>d%7
```
### Old solution with string input
```
s=>new Date(s)%7
```
[Try it online!](https://tio.run/##y0osSyxOLsosKNHNy09J/Z9m@7/Y1i4vtVzBJbEkVaNYU9X8f3J@XnF@TqpeTn66RlqCkYGBoa4hEBklaHJhSBnoGhjpGllikzLSNTDXNTDBocsCaGaC5n8A "JavaScript (Node.js) ‚Äì Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 49 bytes
```
lambda*t:date(*t).weekday()
from datetime import*
```
[Try it online!](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUavEKiWxJFVDq0RTrzw1NTslsVJDkyutKD9XASRekpmbqpCZW5BfVKL1v6AoM69EI03DyMDAUMcQiIw0NbmQBA10jHQsUYWMdMx1TNBVWQA1a2r@BwA "Python 3 ‚Äì Try It Online")
Represents mon-sun as 0-6
[Answer]
# Excel, 10 bytes
```
=MOD(A1,7)
```
Returns `0W/01/1900` where `W` is `0`‚Äì`6` for Saturday‚ÄìFriday.
[![Excel screenshot](https://i.stack.imgur.com/bbXdR.png)](https://i.stack.imgur.com/bbXdR.png)
[Answer]
# Mathematica, 7 bytes
```
DayName
```
## Mathematica (without `DayName`), ~~49~~ ~~42~~ 38 bytes
```
First@DateDifference[{1,1,1},#]~Mod~7&
```
[View it on Wolfram Cloud!](https://www.wolframcloud.com/obj/2f7e7dd4-9d31-4d34-92d6-2f20e1b620be)
Takes dates in `MM/DD/YYYY` format (will complain if the date happens to be parsable as `DD/MM/YYYY`, but it still outputs the correct answer). `DayName` returns the full name of the weekday. The other answer returns 0 for Monday, 1 for Tuesday, up to 6 for Sunday.
The non-`DayName` answer can probably still be golfed a decent amount, I'm pretty new to Mathematica.
[Answer]
# [APL(Dyalog Unicode)](https://dyalog.com), 7 bytes [SBCS](https://github.com/abrudz/SBCS)
Anonymous tacit prefix function taking date as `YYYY MM DD`.
```
7|1‚éïDT‚äÇ
```
[Try it on APLgolf!](https://razetime.github.io/APLgolf/?h=AwA&c=M68xfNQ31SXkUVcTAA&f=e9Q39VHbhDQFIwMDQwVDIDLieoQQMlAwMFIwskQWMlIwMFcwMEFTZQHUCwA&i=AwA&r=tryapl&l=apl-dyalog&m=train&n=f)
`‚äÇ`‚ÄÉenclose to make a scalar date
`1‚éïDT`‚ÄÉconvert to Dyalog Day Number (days since 1899-12-31)
`7|`‚ÄÉremainder when divided by 7 (gives 0‚Äì6 for Sunday‚ÄìSaturday)
[Answer]
# [Factor](https://factorcode.org/), 11 bytes
```
day-of-week
```
[Try it online!](https://tio.run/##BcFBDoIwEAXQfU/xPQCmuCJo3Bo3bAwHmLSfxLQWHMaYnr68t0iwVdv8ek6PEUEySxRFohZmbEqzuum7GHZ@fyyBO67OXbz38AP6HrcoxjtwQsUH0bUotVuX7k@mdm4H "Factor ‚Äì Try It Online")
Takes input as a `timestamp`. Outputs an integer `0-6` signifying `Sunday-Saturday`.
[Answer]
# [Nibbles](http://golfscript.com/nibbles/index.html), ~~21~~ ~~20.5~~ ~~16.5~~ 15.5 bytes (31 nibbles)
*Edit: -4 bytes thanks to [Arnauld](https://codegolf.stackexchange.com/questions/252621/which-weekday-was-it#comment562554_252644)*
```
%-+/*23@9+_$?-@2 2/%_3~7
```
Saturday is `0` ... Friday is `6`.
Uses [Arnauld's simplified approach](https://codegolf.stackexchange.com/questions/252621/which-weekday-was-it#comment562554_252644).
```
%-+/*23@9+_$?-@2 2/%_3~7    
    *23@                     # month times 23
   /    9                    # integer-divided by 9 
  +                          # add this to 
         +_$                 # the year plus the day
 -                           # and subtract
            ?-@2             # if the month is ‚â§2
                 2           # 2
                             # otherwise
                   %_3       # year modulo 3
                  /   ~      # integer-divided by 2
%                      7     # finally, modulo 7
```
[![enter image description here](https://i.stack.imgur.com/xBPEF.png)](https://i.stack.imgur.com/xBPEF.png)
[Answer]
# [PowerShell](https://github.com/TryItOnline/TioSetup/wiki/Powershell), 16 bytes
```
%{date $_|% D*k}
```
[Try it online!](https://tio.run/##K8gvTy0qzkjNyfmvbmRgYKhrCERG6joKIJ6BroGRrpEllGeka2Cua2CCkLMAKlZXqPmvWp2SWJKqoBJfo6rgopVd@/8/AA "PowerShell ‚Äì Try It Online")
Input comes from the pipeline.
Straightforward:
```
%{date $_|% D*k}
%{             }  # % is an alias for ForEach-Object; the loop variable in the ScriptBlock "{}" is $_
  date $_         # pass the string as input to Get-Date, which will return a DateTime object
         |% D*k   # pipe the DateTime object to ForEach-Object, this time not with a ScriptBlock, but instead calls the member DayOfWeek
                  # Output is implicit
```
**Disclaimer:** This drops the `Get-` from `Get-Date`; if PS finds no other command with that name, it will try to add `Get-` and find the cmdlet `Get-Date`; don't use this in regular scripts, as the search for the command will slow it down.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~22~~ 21 bytes
Takes input as an array like `[Y,M,D]` and returns a number from `0` (Sunday) to `6` (Saturday).
-1 byte thanks to [Dingus](https://codegolf.stackexchange.com/users/92901/dingus)
```
->d{Time.gm(*d).wday}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpclW0km5RSmJJqlLsojTbpaUlaboWW3XtUqpDMnNT9dJzNbRSNPXKUxIrayFyN-MLFNKio40MDAx1FAxB2Cg2VkFZwTefCyZhoKNgBESWYPGQUrg4UNBcR8EEIpyBrNwCZBRY3K0IYs2CBRAaAA)
[Answer]
# [MATL](https://github.com/lmendo/MATL), 3 bytes
```
8XO
```
Input format is `YYYY/MM/DD`.
[Try it online!](https://tio.run/##y00syfn/3yLC//9/dSMDA0N9QyAyUgcA) Or [verify all test cases](https://tio.run/##y00syfmf8N8iwv@/S8h/dSMDA0N9QyAyUucCcQz0DYz0jSwhHCN9A3N9AxO4jAVQpToA).
[Answer]
# [Julia 1.0](http://julialang.org/), ~~41~~ 39 bytes
```
using Dates;!d=Dates.dayofweek(Date(d))
```
[Try it online!](https://tio.run/##yyrNyUw0rPj/v7Q4My9dwSWxJLXYWjHFFszQS0mszE8rT03N1gDxNVI0Nf/nJhZoKOpEKxkZGBjqGgKRkZKOAohnoGtgpGtkCeUZ6RqY6xqYIOQsgIqVYjUVauwUCooy80r@AwA "Julia 1.0 ‚Äì Try It Online")
*Saved 2 bytes thanks to [Steffan](https://codegolf.stackexchange.com/users/92689/steffan)!*
Returns 1 for Monday, 2 for Tuesday, up to 7 for Sunday.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~29~~ 21 bytes
```
4·∏ä2"?3‚â•i???23*9·∏≠W∆í-7%
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyIiLCIiLCI04biKMlwiPzPiiaVpPz8/MjMqOeG4rVfGki03JSIsIiIsIjIwMDFcbjExXG4xMiJd)
Port of 05AB1E.
[Answer]
## JS, ~~23~~ 13 bytes
Passed as string
```
s=>new Date(s).getDay()
```
Passed as object, per OP
```
d=>d.getDay()
```
[Answer]
# [Go](https://go.dev), ~~96~~ 85 bytes
```
import."time"
func f(d string)int{e,_:=Parse("02/01/2006",d);return int(e.Weekday())}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=XY1LCsIwEED3PUXIKoHapEG0Kt6hG3EpoU1KqElLmi6keBI3RfAS3sTbmH4Q6Wpg3sx7j2dR9e-aZyUvBNBcmUDpurIORFBqB1-tk6vkc5qWEXRKCxjI1mRAohw0zipTYGVcJ8LL_phy2wgEKSM0JozSDQxzfLDCtdYAf4VEdBaizPkNYXyf5c2oG9oIgy5IvdJdDZIIxozEoyeGGP8DtiO-4QFdALomdDsAtgDeQ5Pfx5zu-2l-AQ)
Hoo ray for verbose builtins!
* -11 bytes for returning an `int` (@Steffan)
[Answer]
# [Nim](http://nim-lang.org/), 47 bytes
```
import times,sugar
x=>x.parse"ddMMyyyy".weekday
```
[Try it online!](https://tio.run/##Vc4xC8MgEIbhPb/icDJQwimFtkI6dc3cWaJJpRhFLTW/3kome9Px8A3vZmwx1ruQIBmrY@eDmyHSRcDx0SwgpmC2tRfw1Pr9kHsPYweg55eDBQjjjHFERhrjN@TVsDU846Uab40xvB67v4ZT/KwydJHm8Z4HL0PURKlp2uuR4VsjVI0o5Qc "Nim ‚Äì Try It Online")
It takes the date in the format `ddMMyyyy` and prints the full name of the weekday.
[Answer]
# [PHP](https://php.net/), 33 bytes
```
<?=date('l',strtotime($argv[1]));
```
[Try it online!](https://tio.run/##K8go@P/fxt42JbEkVUM9R12nuKSoJL8kMzdVQyWxKL0s2jBWU9P6////RgZGRrqGBroGZgA "PHP ‚Äì Try It Online")
[Answer]
# [APL(Dyalog Unicode)](https://dyalog.com) REPL, 0 bytes
Takes date as `7|1‚éïDT‚äÇYYYY MM DD` and gives 0‚Äì6 for Sunday‚ÄìSaturday
[Try it on TryAPL!](https://tryapl.org/?clear&q=7%7C1%E2%8E%95DT%E2%8A%822001%2011%2012&run)
This abuses [OP ruling](https://codegolf.stackexchange.com/questions/252621/which-weekday-was-it/252685#comment562260_252621) that a valid input format can contain the code that solves the problem. For an explanation, see [my other APL answer](https://codegolf.stackexchange.com/a/252684/43319).
[Answer]
# jq, 17 characters
```
strptime("%F")[6]
```
Input: YYYY-MM-DD  
Output: 0 = Sunday .. 6 = Saturday
Sample run:
```
bash-5.1$ jq -R 'strptime("%F")[6]' <<< '2012-05-04'   # manatwork joined CGCC
5
```
[Try it online!](https://tio.run/##yyr8/7@4pKigJDM3VUNJ1U1JM9os9v9/IwMDQ11DIDL6lw@Uy88r/q@rW5RYrpuZV1BaAgA "jq ‚Äì Try It Online") / [Try all test cases online!](https://tio.run/##lY9NS8NAEIbP3V8xrmk3OSxsltYPTEAPFjyIULzFUGKyJdGaxN0NCNXfns6mpdWDh8IyMzz7zsw7r5kp@0Ll60wr4HdglbHLPDMq9skoYVKIkIf4JEvjEM7hsdljwYXk8hqxRPzc7bHk4pKLKeKpw@VRfYVzEM8QzzUJCGl1VdsVsG8Y83BmYMjiT5YYX2oG7KFuO4t5oUy3dsX9V6tyqwosn94ZIatGQ@VEGIF6m7PDIclt@kNvoEDjeuiOqefD2yfwBbDeWN3a6kP5dDynQXKR9gyiKMIRwzQKASVkdILVQyP1dutctTm62X2jJXA2kuSXLo7/k6YpTCag8rIZznWmiqZW/RY "Bash ‚Äì Try It Online")
[Answer]
# Rust + chrono, ~~58~~ 21 bytes
```
chrono::Date::weekday
```
[Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9c37c5abb57131f38aba75997ac8a594)
An expression that can be coerced to a `fn(&Date<Utc>)->Weekday`. It takes a Date object and returns Weekday, an enum with 7 possible values.
[Answer]
# Java, 13 bytes
```
d->d.getDay()
```
A `Function<java.util.Date, Integer>`. Returns 0 for Sunday, 1 for Monday, ..., 6 for Saturday.
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Input as a string in the format `yyyy-mm-dd` (or any valid JavaScript date string), output as a 3 letter abbreviation.
```
3√Æ√êU
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=M%2b7QVQ&input=IjIwMDEtMTEtMTIi)
```
3√Æ√êU     :Implicit input of string U
3√Æ       :Slice to length 3
  √êU     :Construct date object from U
```
**Note:** This is locale/browser dependent. For the included test case, for example, the date object is expected to return `Mon Nov 12 2001 00:00:00 GMT+0000 (Greenwich Mean Time)`.
[Answer]
# [Thunno 2](https://github.com/Thunno/Thunno2) `t`, 22 [bytes](https://github.com/Thunno/Thunno2/blob/main/docs/codepage.md)
```
4·∏ä2,$3¬Æi‚Å∂¬∞¬π23√ó9√∑Kr∆≤-7%
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m728JKM0Ly_faGm0UolS7IKlpSVpuhY3FUwe7ugy0lExPrQu81HjtkMbDu00Mj483fLwdu-iY5t0zVWXFCclF0NVL1hlZGBgyGUIREYQEQA)
Port of Kevin Cruijssen's 05AB1E answer.
#### Explanation
```
                        # implicit input
4·∏ä                      # divisible by 4
  2,                    # pair with 2
    $                   # next input
     3¬Æ                 # greater than or equal to 3
       i                # indexing
        ‚Å∂               # third input
         ¬∞              # first input
          ¬π             # second input
           23√ó          # multiply by 23
              9√∑        # floor divide by 9
                Kr      # push the stack
                  ∆≤     # cumulative reduce by:
                   -    #  subtraction
                    7%  # modulo 7
                        # implicit output of tail
```
[Answer]
# [Python 3](https://docs.python.org/3/), 69 bytes
```
lambda y,m,d:((d+((y+y//4)+(0x562ad0e6c0>>m*3&7)))-(m<3)*(y%4<1)+6)%7
```
[Try it online!](https://tio.run/##DcJBCoMwFAXAq7ixvGdSjEYjFPUkbtKm0oJRKS76Tx8dZpfjs602zcOUFh@fwWeiow4PIChAlJRlQwXzb13tg3m7lxnHWNhbR/KO2FsWkLzpKyrHvEv777semFE5ndVXQ6YT "Python 3 ‚Äì Try It Online")
]