[Question]
  [
Given a textual representation (case-insensitive full name or 3 character abbreviation) of a month return the number of days in the month.
For example, `december`, `DEC`, and `dec` should all return 31.
February can have either 28 or 29 days. 
Assume the input is a month in one of the correct forms.
  
[Answer]
# JavaScript (ES6), ~~48 47 44 43~~ 42 bytes
```
m=>31^'311'[parseInt(m[1]+m[2],34)*3%49%8]
```
### Demo
```
let f =
m=>31^'311'[parseInt(m[1]+m[2],34)*3%49%8]
;(
  'JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,' +
  'JANUARY,FEBRUARY,MARCH,APRIL,MAY,JUNE,JULY,AUGUST,SEPTEMBER,OCTOBER,NOVEMBER,DECEMBER'
).split`,`
.forEach(m => console.log(m, '->', f(m)))
```
### How?
These operations lead to a lookup table of 8 entries, which would not be very interesting if the values were randomly distributed. But any result greater than **2** is mapped to **31** days. Therefore, only the first 3 entries need to be stored explicitly.
```
Month | [1:2] | Base 34 -> dec. | * 3  | % 49 | % 8 | Days
------+-------+-----------------+------+------+-----+-----
  JAN |    AN |             363 | 1089 |   11 |   3 |  31
  FEB |    EB |             487 | 1461 |   40 |   0 |  28
  MAR |    AR |             367 | 1101 |   23 |   7 |  31
  APR |    PR |             877 | 2631 |   34 |   2 |  30
  MAY |    AY |              10 |   30 |   30 |   6 |  31
  JUN |    UN |            1043 | 3129 |   42 |   2 |  30
  JUL |    UL |            1041 | 3123 |   36 |   4 |  31
  AUG |    UG |            1036 | 3108 |   21 |   5 |  31
  SEP |    EP |             501 | 1503 |   33 |   1 |  30
  OCT |    CT |             437 | 1311 |   37 |   5 |  31
  NOV |    OV |             847 | 2541 |   42 |   2 |  30
  DEC |    EC |             488 | 1464 |   43 |   3 |  31
```
[Answer]
# Javascript (ES6), ~~36~~ 33 bytes
-3 bytes thanks to @JustinMariner and @Neil
```
m=>31-new Date(m+31).getDate()%31
```
Sorry @Arnauld, abusing JavaScript weirdness is shorter than your fancy base conversions.
### How it works
For some reason, JavaScript allows entering dates outside of the specified month. The code counts how many days outside the month the date is to determine how many days there are in the month. Examples:  
`"FEB31"` → `Thu Mar 02 2000` → `31 - 2 % 31` → `29`  
`"October31"` → `Tue Oct 31 2000` → `31 - 31 % 31` → `31`
### Test cases
```
f=m=>31-new Date(m+31).getDate()%31
;(
 "JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC,"+
 "January,February,Mars,April,May,June,July,August,September,October,November,December"
).split`,`.forEach(s=>console.log(s,"->",f(s)))
```
[Answer]
# [Python 2](https://docs.python.org/2/), ~~46~~ ~~45~~ 38 bytes
*-1 byte thanks to @totallyhuman*
```
lambda m:29-int(m[1:3],35)%238%36%-5/2
```
[Try it online!](https://tio.run/##K6gsycjPM/qfZhvzPycxNyklUSHXyshSNzOvRCM32tDKOFbH2FRT1cjYQtXYTFXXVB@oNL9IIVchM08hWt3L0U9dR0HdzdUJRPk6BoEox4AgCC8SRHmF@kEoH7BcqDuICnYNAFH@ziEgys8/DES5uDqrx1pxKSgUFAFtV8jVUUjTyNX8DwA "Python 2 – Try It Online")
[Answer]
# [Proton](https://github.com/alexander-liao/proton), 50 bytes
```
k=>31-((e=k.lower()[1to3])in"eprunov")-3*(e=="eb")
```
[Try it online!](https://tio.run/##XctBC4IwGIDhez9jpy0wEM8LNAYVIrL0ENFB7TPU3CdrM/r1q0ME8/rwvpNGg8q13A18G4UBpcCHzQNfoCm7hAajK@sUgUlbhTNhQbT@FpxATZibdKcMbSnpq6ys5JswtvpbKxJpY332cIxls/ekyvUhXTT@05cZeHC0qV/E9l4@C49OkBsYE5CeYlNgIrRnGc5irBd4g5343e4D "Proton – Try It Online")
-14 bytes thanks to Jonathan Frech
Thirty days hath September, April, June, and November. All the rest had peanut butter. All except my grandmother; she had a little red trike, but I stole it. muahahahahaha
(I've been waiting to tell that joke (source: my math professor) for ages on this site :D :D :D)
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 21 bytes
```
cal $1|xargs|tail -c3
```
[Try it online!](https://tio.run/##S0oszvj/PzkxR0HFsKYisSi9uKYkMTNHQTfZ@P///2mpSQA "Bash – Try It Online")
Takes input as command-line argument and outputs with a trailing newline. The day count for February depends on that of the current year
Requires the **util-linux 2.29** version of `cal`, which is the one [available on TIO](https://tio.run/##S0oszvj/PzcxTyE5Mef/fwA). Also is locale-dependent, so [LC\_TIME must be changed](https://tio.run/##S0oszvj/38c5PsTT19XWWSE5MUdBxbCmIrEovbimJDEzR0E32fj///9pqUkA) on non-English systems (thanks @Dennis for clarification).
Idea of piping through `xargs` to trim `cal`'s output is from [this SO answer](https://stackoverflow.com/a/12973694/8161100).
[Answer]
# [APL (Dyalog)](https://www.dyalog.com/), ~~32~~ 27 [bytes](https://codegolf.meta.stackexchange.com/a/9429/43319 "When can APL characters be counted as 1 byte each?") ([SBCS](https://github.com/abrudz/SBCS ".dyalog files using a single byte character set"))
-2 thanks to ngn
Tacit prefix function. Assumes `⎕IO` (**I**ndex **O**rigin) `0`, which is default on many systems.
```
32-1⌈∘⊃'.p|un|no|feb'⎕S 1⍠1
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT///qG@qp/@jtgkG/42NdA0f9XQ86pjxqKtZXa@gpjSvJi@/Ji01SR2oKFjB8FHvAsP/aUC1j3r7gEoe9a551Lvl0HrjR20TQQqCnIFkiIdn8P80BXWvxDx1LiDt5uoEpnMTi5IzwCzHgCBPH6hYJZj2CvVzBTOySnMgSkrTwXSwa0CIq6@TaxCY559ckp@UWgRm@@WXpebCOCmpyRBVAA "APL (Dyalog Unicode) – Try It Online")
`1⌈∘⊃` and use the maximum of one and the first element of that (0 if none) to pick from
`32-` thirty-two minus
`1⌈∘` the maximum of one and
`⊃` the first element (0 if none) of
`'.p|un|no|f'⎕S` the PCRE \**Search* for any-char,"p" or "un" or "no" or "f"
`1` returning the length of the matches
`⍠1` and done case insensitively
* **Ap**r, S**ep**, J**un**, and **No**v will give 32−2=30
* **Feb** will give 32−3=29 (allowed by OP)
* anything else will give 32−1=31
[Answer]
# [Pyke](https://github.com/muddyfish/PYKE), 9 bytes
```
l4C9@~%R@
```
[Try it here!](https://pyke.catbus.co.uk/?code=l4C9%40~%25R%40&input=December&warnings=1&hex=0)
```
l4        -   input.title()
    @     -  v.index(^)
  C9      -   ['PADDING', 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
        @ - v[^]
     ~%R  -  ['Padding', 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
```
### Or 15 bytes if all input formats are required
```
l43<C9 3L<@~%R@
```
[Try it here!](https://pyke.catbus.co.uk/?code=l43%3CC9+3L%3C%40~%25R%40&input=Feb&warnings=1&hex=0)
```
l43<            -   input.title()[:3]
          @     -  v.index(^)
    C9 3L<      -   ['PAD', 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
              @ - v[^]
           ~%R  -  ['Padding', 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
```
[Answer]
# [C# (.NET Core)](https://www.microsoft.com/net/core/platform), 52+13=65 38+24=62 bytes
```
m=>D.DaysInMonth(1,D.Parse(1+m).Month)
```
[Try it online!](https://tio.run/##jc5BSwMxEAXgs/kVoacE20DP6xaKoVBxoaAgHsd00JHNRDNZYSn97WvdWq/u8b35eEyQRUgZh06IX/VDLwVjpc7J1@fsPBR8pIiXw299T/xZqdCCiN4dlBQoFPSm43AjJZ/gXBOXlW4SlzcPvehaD7FeefcTtjz2Zjn3bgdZ0Cyvo3VjaYdKXfa@Eu11A8TGqoO6uk0sqUX3lKng6QM0f/Nmdgc8s7b6R23wJXeQ@wk0Qp6g1h@Z2gmuWT9PUO8d48iO6jh8Aw "C# (.NET Core) – Try It Online")
+24 for `using D=System.DateTime;`
### Acknowledgements
-3 bytes thanks to Grzegorz Puławski.
[Answer]
# [Python 3](https://docs.python.org/3/), 60 bytes
```
x=input().lower()[1:3];print(31-(x in"eprunov")-3*(x=="eb"))
```
[Try it online!](https://tio.run/##K6gsycjPM/7/v8I2M6@gtERDUy8nvzy1SEMz2tDKONa6oCgzr0TD2FBXo0IhM08ptaCoNC@/TElT11hLo8LWVik1SUlT8/9/r0Q/AA "Python 3 – Try It Online")
Porting my Proton solution
-10 bytes thanks to totallyhuman
[Answer]
## [Shell/GNU Date](https://www.gnu.org/software/coreutils/manual/html_node/Examples-of-date.html), ~~39~~, 26 bytes
```
date -d1$1+1month-1day +%d
```
Where `$1` is the name of the month.
[Try it online!](https://tio.run/##S0oszvj/PyWxJFVBN8VQxVDbMDc/ryRD1zAlsVJBWzXl////aalJAA)
*edit: Thanks [Dennis](https://codegolf.stackexchange.com/users/12012/dennis) for saving many bytes!*
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), ~~45~~ 44 bytes
```
L=tolower($1){$0=L~/v|p|un/?30:L~/f/?28:31}1
```
[Try it online!](https://tio.run/##NYxBDoMgEADv@woOHtoTUi@NifEDfgLp2tYqEAQN0fbrFGh62Z3dZIZvrxC6xqpJbWhOBTvvRdl0H7oe@nCStlVZx2ug7eVaV@zNQhi5hAF7mLkBrk3cnsDoZBoTAe7usKAGJSxItcINBUTFceOTZjJEVzxI0p9R@RcwJ3xuuMWS1LE492hIyqkMsZlfKfyDLw "AWK – Try It Online")
[Answer]
# [Perl 5](https://www.perl.org/), 47 + 1 (`-p`) = 48 bytes
```
$_=substr$_,1,2;$_=31-("eprunov"=~/$_/i)-3*/b/i
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3ra4NKm4pEglXsdQx8gayDc21NVQSi0oKs3LL1OyrdNXidfP1NQ11tJP0s/8/z8rMe9ffkFJZn5e8X9dX1M9A0OD/7oFAA "Perl 5 – Try It Online")
[Answer]
# [Haskell](https://www.haskell.org/), ~~65~~ ~~63~~ 62 bytes
```
f.map((`mod`32).fromEnum)
f(_:b:c:_)|c<3=28|c>13,b>3=30
f _=31
```
[Try it online!](https://tio.run/##dYzBaoNAFEX3fsVFulBoQxM3RWrAJqYgjYakKRQKZhxHk1RnhtFJEfLtsdN0ncV953B53D1pv1ldD1XwNZSjhkjH2TWi2HkTd1Qq0URcN65VOpmf@9TP3DN99oLJ05lOx959PvUC79EqkQXeeGjIgSNAISxIdeAd7mD2UBn@CFW0sOMwwSJ6wTJcI1ytDT8RbxOTN4TbV2yiFdLZO5L0A/NoZt8cOhKOkuWmViBSGfY4am5Sg@gKLZMQtAMXJxSM3h6KCddE9ViwXF1lSRTdIzTvtfEesebMnLpHqCvddtgw2bEmZwop7cQfE3H6L@aMXsUeLrSsSdUOD1TKXw "Haskell – Try It Online")
Pattern matching approach. The first line is to handle the case-insensitivity. Then we return `28` if the third letter is smaller than C (number 3), `30` if the second letter is larger than C and the third one larger than M, or `31` otherwise.
*Edit: -1 byte thanks to Leo*
---
### Alternative (~~65~~ 64 bytes)
```
f s|let i#n=n<mod(fromEnum$s!!i)32=sum$29:[2|2#2]++[-1|2#13,1#3]
```
[Try it online!](https://tio.run/##dYyxbsIwFEX3fsUlYWhFGRKmVs2QQqgUlYCgVKoQg@M4IdSxLTumisS3k7p0ZrjvHF093QMx34zzvi9hzpy1qH0RiZdGFvellk0ibDM0g0H9MAkj4zx8et6F59AP96PRbhw4CyaPgT/Z9w2pBSIU8g5K16LFEA1RKB1/pC4MvDTOME9esYjXiFdrxy@k28zlHfH2DZtkheX0A9nyE7Nk6t0cOhKBkuWu1iBKO3Y4WuHCQWwFwxQkbSHkCQWjt4dSIizRHeYs11dZEE0PiN07d94htYK5wzvEtrKmxYapljU501jSVv4xk6f/YsboVbz@QktOKtOPqVK/ "Haskell – Try It Online")
[Answer]
# q/kdb+, 36 bytes
**Solution:**
```
28 30 31@2^1&(*)"ebeprunov"ss(_)1_3#
```
**Examples:**
```
q)28 30 31@2^1&(*)"ebeprunov"ss(_)1_3#"January"
31
q)28 30 31@2^1&(*)"ebeprunov"ss(_)1_3#"FEB"
28
q)28 30 31@2^1&(*)"ebeprunov"ss(_)1_3#"jun"
30
```
**Explanation:**
There are a million ways to skin a cat. I think is slightly different to the others. Take the 2nd and 3rd letters of the input, lowercase them, then look them up in the string `"ebeprunov"`. If they are at location 0, then this is February, if they are at a location >0 they are a 30-dayer, if they are not in the string, they are a 31-dayer.
```
28 30 31@2^1&first"ebeprunov"ss lower 1_3# / ungolfed solution
                                        3# / take first 3 items from list, January => Jan
                                      1_   / drop the first item from the list, Jan => an
                                lower      / lower-case, an => an
                  "ebeprunov"ss            / string-search in "ebeprunov", an => ,0N (enlisted null)
             first                         / take the first, ,0N => 0N
           1&                              / take max (&) with 1, 0N => 0N
         2^                                / fill nulls with 2, 0N => 2
        @                                  / index into
28 30 31                                   / list 28,30,31
```
[Answer]
# Mediawiki Template, 19 bytes
```
{{#time:t|{{{1}}}}}
```
[Answer]
# [MATL](https://github.com/lmendo/MATL), 22 bytes
```
14L22Y2c3:Z)Z{kj3:)km)
```
[**Try it online!**](https://tio.run/##y00syfn/39DEx8go0ijZ2CpKM6o6O8vYSjM7V/P///zkEAA "MATL – Try It Online")
### Explanation
```
14L    % Push numeric array of month lengths: [31 28 ... 31]
22Y2   % Push cell array of strings with month names: {'January', ..., 'December'}
c      % Convert to 2D char array, right-padding with spaces
3:Z)   % Keep first 3 columns
Z{     % Split into cell array of strings, one each row
k      % Convert to lower case
j      % Input string
3:)    % Keep first 3 characcters
k      % Convert to lower case
m      % Ismember: gives a logical index with one match
)      % Use that as index into array of month lengths. Implicit display
```
[Answer]
# [Python 3](https://docs.python.org/3/) - ~~93~~ ~~86~~ ~~84~~ 82 bytes
Variants of answer (showing the progression of time, and bytes for each, with TIO links):
[Original Answer](https://tio.run/##LcsxCoQwEEDRq6QRJyCC2ClbbLvFXkAsxhg1YCZhHCGePq6w3ePDj5dsgdqcnY@BRYnztv/b4G5pRlZ4KNMvrx39NKNKnccEpvaBZGOk1UJTPV99CMcHkIauHauymEo9NKPWObIjgQUcxVNA/8oHv@ebrxs) (93 bytes)
[-7 bytes thanks to Jonathan Frech.](https://tio.run/##NcyxCoNADIDhV3EpJnAI4mbp0LVDX8A6xHrWA5M70gjn019x6PbDB386bI3SleX2KhvxNFOVe6YMb9q8zKQNR7FVST4eWmeBffM1TWdAHvpudPVlqnFoR8Rr4BTVqhPdf1CSBjFYIEjaDRCxPOi53/X4AQ) (86 bytes)
[-2 more bytes thanks to my own further testing of the `monthrange` results, with the second value always being the higher value.](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHCKjkxJzUvJbFILzc/rySjKDEvPVXDUKckMzdVr7ikqADE0KiItjKO1VFXTVLXjDaMBWHrzNyC/KISBZC0DsyI/wVFmXklGmkamXkFpSUampqa/91SnYpCixKLKgE) (84 bytes) 1
[-2 more by using `import calendar as c` and referencing it with `c.monthrange`.](https://tio.run/##FclBCoMwEEDRq2RTnEAQxJ2lR@gJrIsxxiZgJsM4gj19ShYfHnz@aSw01v31qQfmdUNzT77PhTQK0jfA4DTl0J8q3AD3PI2L6x5rZ@dhaT1T5iJq2nYej0AbisHT@MqSSGGHRHwpWGvrG8XHPw) (82 bytes, **current revision**)
---
```
lambda x:c.monthrange(1,time.strptime(x[:3],'%b')[1])[1];import time,calendar as c
```
---
Obviously not as nice as [HyperNeutrino's answer](https://codegolf.stackexchange.com/a/146562/4949) which doesn't use built-ins, but this still works.
---
*Footnotes*
1: [Test cases via TIO.run](https://tio.run/##Hc5RC4IwEMDxdz/FEYxtMATxzbeoCIIwqB5CfJhrpqI3mbPo01vn0@/PcRw3fkPjMF2WdhidDxDawSqje4tP7UFPYKLaeUBoEQreaeQKeG0rYtDeNBR69G1PcdYP4nRf17p5HW7nI3E9XIh8dyMwfxN7a3iZRQD/CxjEhk0ZsGkDDATGvftYL6QCEw8OQ@M1vqxIFP0YT8GPFAKLLC0VZxWXRVJKKZflBw) showing the proof for how I'm handling those `monthrange` values, for a varying number of month test cases.
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), ~~46~~ 30 bytes
```
#~NextDate~"Month"~DayCount~#&
```
[Try it online!](https://tio.run/##y00syUjNTSzJTE78n5JYWWz7X7nOL7WixCWxJLVOyTc/ryRDqc4lsdI5vzSvpE5Z7X9AUWZeiYNzfk5pbp5bflFudDWXggJIZ7SSV2JeaWJRpVKsDlwoLTUJmZvrWOScgSzgGBCEIp@Iotsr1M9VKZarNvY/AA "Wolfram Language (Mathematica) – Try It Online")
Will give either `28` or `29` for February depending on whether the current year is a leap year.
# How it works
All date commands in Mathematica will interpret input such `April`, `APR`, `ApRiL`, and so on as the first day of the corresponding month in the current year. (As a bonus, input such as `"February 2016"` or `{2016,2}` also works as expected.)
`#~NextDate~"Month"` gives the first day of the month after that, and `DayCount` gives the number of days between its two arguments. The number of days between April 1st and May 1st is 30, the number of days in April.
[Answer]
# [Java 8](http://openjdk.java.net/), 47 bytes
```
m->31-new java.util.Date(m+"31 1").getDate()%31
```
[Try it online!](https://tio.run/##dU/BasMwDL33K4RhkNDGLOS2rj2N3cYOO44dZNfNnDm2seWOMPbtmeMGdtlskB7Se3rSgBdsnFd2OH3MPgmjJUiDMcITagtfm7UWCSmni9MnGHOneqGgbf/6Bhj6WGfikCfxRNrwc7KStLP8cQX3V/LuWQxK0hEWAhzmsTl2bWPVJ/xqH5BUNW5Z10LLat4rKpX6pmvn/ebsAqzOQCoS3AEb0CYME5yVCAWMGOQ7oA/aZDzBkKzKwUyAqU9ZFJUnNQoVwElyS7buci2clCyA8eiNpooBq5fjIL/VF4UIcCj2PCYRS7W63XX1/kqbYp7OXSKeV7BkbFVW3QKD5pjDttzP0XszlVb9v7KY/a1cWovye/nzDw)
Ended up using the same idea as [Herman Lauenstein's JS answer](https://codegolf.stackexchange.com/a/146593/69583), where setting the date to the 31st pushed into the next month. Java does require a year, so that has been set to `1`.
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~32~~ ~~31~~ 28 bytes
```
i`f
28
i`p|v|un
30
\D
^$
31
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPzMhjcvIgiszoaCmrKY0j8vYgCvGhYsrToXL2PD/f6/EvNLEokout9SkIjDDN7EoOYPLsaAoMwfIruTyKs1LBRI5lVyOpemlxSVcwakFJam5SalFXP7JJfkg2i@/DCLgkpoMZgAA "Retina – Try It Online") Edit: Saved 1 byte thanks to @RobertBenson. Saved 3 bytes thanks to @ovs.
[Answer]
# Excel VBA, ~~47~~ 43 Bytes
Anonymous VBE immediate window function that takes input, as month name, abbreviation, or number, from range `[A1]` and outputs the length of that month in the year 2001 to the VBE immediate window function.
```
?31-Day(DateValue("1 "&[A1]&" 1")+30)Mod 31
```
### Old Version
```
d=DateValue(["1 "&A1&" 1"]):?DateAdd("m",1,d)-d
```
[Answer]
# PHP, ~~38~~ ~~33+1~~ 32+1 bytes
*Saved 5 bytes thanks to Titus*
```
<?=date(t,strtotime("$argn 1"));
```
Run as pipe with `-nF`
[Try it online!](https://tio.run/##JcxBCoNADAXQ/ZziI10oVKRrtbPrPaYYNVAzYYz09k1L3T@eruo@xHBJZZFxpmePrgNtxysZoRwiLAvebCuUlZBkQvtAVuMsId7DEMfpR2u77lYsG29UV/8Nt6ppevfPiXdv5Qs)
[Answer]
# [Java (OpenJDK 8)](http://openjdk.java.net/), 126 bytes
```
s->{for(java.time.Month m:java.time.Month.values())if(m.name().startsWith(s.toUpperCase()))System.out.print(m.length(false));}
```
[Try it online!](https://tio.run/##nY5NS8NAEIbP5lcsOe0K3R9gtGCLgmJPpXgQD9tkkm7cL3ZmA6Xkt8fFVpAePGSO78wz79OrQS18ANc3X5O2wUdifc5kIm1km1xN2jt5W4W0N7pmtVGIbKO0OxVIinK09g6ThXi/pahdt2SNOuKL23hHB/bAJlwsT62P/OctaQvyvLJ3V4kclEmAXAjdciudssCFzC2R8F3TgaMkvwsB4lphXgmxPSKBlT6RDLmbMmXAdfm0VQZBiGqcfs0vtoPXDbPZn591Pz6ZEuxUsMv8kZeqriEQL5@fVqWoipvrOuN4jv8jG6jB7iHOxBHCTPJ19zaTfExdQiovV2MxTt8 "Java (OpenJDK 8) – Try It Online")
[Answer]
# [QBIC](https://drive.google.com/drive/folders/0B0R1Jgqp8Gg4cVJCZkRkdEthZDQ), ~~49~~ 35 bytes
```
?31-(instr(@aprjunsepnov feb`,;)%3)
```
Significantly shorter with some trickery.
## Explanation
```
?                          PRINT
31-(                       31 minus
  instr(                   the position of
                      ,;   our input string
    @aprjunsepnov feb`  )  in the string cntaining all non-31 months                                
    %3)                    modulo 3 (this yields a 1 for each month except feb=2)
```
[Answer]
## [Perl 5](https://www.perl.org/), 24 bytes
**23 bytes code + 1 for `-p`.**
```
$_=31-/p|un|no/i-/f/i*3
```
[Try it online!](https://tio.run/##K0gtyjH9/18l3tbYUFe/oKY0ryYvXz9TVz9NP1PL@P9/r8S80sSiSi631CSu3MSi5AyuxIIiLl/HSC6vUD8ur9KcSi7H0nSu4tSCktTcpNQirvzkEi4//zBXXyfXIC4XV2euf/kFJZn5ecX/dQtyAA "Perl 5 – Try It Online")
[Answer]
# [Ruby](https://www.ruby-lang.org/), 45 bytes
```
->m{((Date.parse(m)>>1)-1).day}
require'date'
```
[Try it online!](https://tio.run/##JYxba8JAFITf/RVDXkyQLPjYhwa2JhZCTURrQUopm3isgVy2eyks6m9Pt@nDzHycM4yylRvPj2OcdNcwTIUhJoXSFHZRkiyjeBmxk3D3maJv2yian3xjPgY5L7DOnrDhO/DtzucR@aHwegE/PGOfbVGuXlGUb0izFXLRW6Ec1lSpCTZC1RdwqZrWs0Nue/LWOnD7ZbXBnqShriKFsjbDXxbDz/8hpXqCYMa0bBvDSPitK27d0JvLDdIajYlZTb0hFT5EWCBAnHhb4Pw@PT@YGT417uMv)
Ruby's `Date.parse` accepts a month name on its own. What would normally be a right-shift (`>>`) actually adds to the month of the `Date` object. Subtraction affects the day of the month, which will wrap backwards to the last day of the previous month.
[Answer]
# [Kotlin](https://kotlinlang.org), 92 bytes
```
val d={m:String->arrayOf(0,31,30,30,31,30,31,28,31,0,30)[(m[1].toInt()+m[2].toInt())%32%11]}
```
[Try it online!](https://tio.run/##jVTbjtMwEH3PV4yqRTRQEtKyCCoKQstyeQIJeFrx4MaTxqxjB1@6rVb7L3zL/liZcdrCIh6IqtSe2zlzPM6lDVqZXfkAzhyKgBIa6yC0ykNtJcLK6gbqVmiNZoXzrA2h9/OyZCf7Ch9EfYkbCiF/Uduu/BHRB2WNL6snT09PT7P39go6YbYgxdaDMiCgsya0r7LsnVoj7wNuQhQaHPYOPZoguAKMa@HxkTJk8SpQLDRRazCiQyCaM2bmRB3QgVguHa5VysvBNgcQKhmiM9QSgondkkLJeWDC1hRWZNlbqogb0fUaJ7c/JdbI0bR8c342AWFkMt7@9K2NWgJJcqg9qzgdly4Kt4VaGGgFcUVF5R1MnzHX6fMESoGvvY/En6GV6WMA0vpAlihZg8yQ3bV1DuvAR9JR5oMyy8oSzjc9kaGTWqPzrNIxWmKxP0aiC8I5v4UrIsFZ/@ifTxpF3UJvvVdLzXwkbmAtdMSCk945sUyZHmtrJIvAs@HkH8Lv0RP/SULay91RuWD5hStimpKFlMlVwBdxmTTgjM7KqC3MpuAt8JEfWzqgeJAWvbkfaJAC7RO7VGKfW1VAWPWx@aEThtTWXkLsD1hD5852CYA0EtuCs6@ETxZtr2h8Bw3IIAInaSRgUqHXKjAOB85AqqZBR8NKc/AjKsdHwml0VE00CWmcZJnD5@CUWeWwyICehPqxGT@ezKrJ7HH6Vfv39Bm/2ZZC@ckvhjIX1bci2A8mjPOHg2F6NOT3ZtN7VfUtTcgX7kA6ui8uMemEMmPhVn4Orxn6xUDnZQ7XHP58CsttQJ/tiD7IxXU3HwIevfw/pkzwDrl/ELvZUT8E9gkdj3OSkDADiQUs27CBxVGc0Xdh@D6NJjBq9neL151wdTua7NUZid4pPdiT@3s0OPzrtBdxFX34He@xD@lis9PWwe6Xxq6P5sPdH@WUxbdkzOTS94JJsmxci1nHvqc7sEgOavkrb89ogsd5CiFyJmgzHp2kCi0N2cm1TOXym@GDMPo7cih5CE27O7E3LCOxytKCzzbb/QI "Kotlin – Try It Online")
[Answer]
# [JavaScript (V8)](https://v8.dev/), 100 bytes
```
(z,v=n=e=b=r=y=u=c=0,t=s=a=l=1,f=p=29,m=j=g=o=30,d=31)=>eval([z[0],z[1],z[2]].join`+`.toLowerCase())
```
[Try it online!](https://tio.run/##dY5Pa4QwFMTP3U8RPCU0DbpeWsrbS6@99iTCxuxbV4lJyB9FSz@71S29FHqZ92PeMEwvRxmU71x8Gp/XCVa68BEMIDTgYYYECnIeIYAEDQW/goPjCx@ghxYslDm/QFkwOOEoNa2WKq/5UhW7HOta9LYz58eziPbdTujfZEDK2Jr10iTpZ3LFxt9hkF7diHS@0xvPpE8GN9EzkalNIZKALuLQoCdWRbtfY8cf44LqDpkITneRZiRjYpCOHhBOn4cHZU2wGoW2LUU@UWTs9Y8rQmpC9DTnJdvGfjj3O3bP///dm77Y@g0 "JavaScript (V8) – Try It Online")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 12 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Uses [Herman's method](https://codegolf.stackexchange.com/a/146593/58974).
```
´H-ÐU+H f uH
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=tEgt0FUrSCBmIHVI&footer=SLExVQ&input=WyJKYW51YXJ5IiAiRmVicnVhcnkiICJNYXJjaCIgIkFwcmlsIiAiTWF5IiAiSnVuZSIgIkp1bHkiICJBdWd1c3QiICJTZXB0ZW1iZXIiICJPY3RvYmVyIiAiTm92ZW1iZXIiICJEZWNlbWJlciJdLW0) (includes all test cases, footer resets the `H` constant for the next case)
]