Resolving the Date Format Dispute The formatting order of dates is one of the most complex and divisive issues the world faces today. Some of us vehemently argue that Month/Day/Year is appropriate, considering that's how we say dates out loud. Others loudly proclaim that Day/Month/Year is best, because it puts the terms in ascending order of the duration they represent.

Enough is enough. Computers can resolve this dispute simply and fairly. Your code, a complete function or program, will take a date string delimited by slashes, e.g. 12/1/2015. Note this is the exact format, without leading zeroes and with a four-digit year at the end.


If it's definitely Month/Day/Year, e.g. 10/31/1998, output a text representation of that date in this exact format, with the full month name, day, and year: October 31, 1998
If it's definitely Day/Month/Year, e.g. 25/12/1989, output the same sort of text representation: December 25, 1989.
If it's ambiguous whether it's Month/Day/Year or Day/Month/Year, output a date that resolves the ambiguity by combining the two possible dates as follows:


Create a new month name by taking the first half of the name of the earlier month and append the second half of the later month. For months with odd length, the first half gets the extra letter. To be explicit, the first halves of the months are Janu, Febr, Mar, Apr, Ma, Ju, Ju, Aug, Septe, Octo, Nove, and Dece and the second halves are therefore ary, uary, ch, il, y, ne, ly, ust, mber, ber, mber, and mber.
Calculate the day by averaging the two possible days, taking the floor when the average is not an integer.
Output the text representation of this date, e.g. for 10/8/2011, output Augber 9, 2011.



If the input date cannot be Month/Day/Year or Day/Month/Year (e.g. 13/13/2013 or even 2/30/2002), any behavior is acceptable. This code golf, shortest code wins!

Test cases:

10/31/1998 gives October 31, 1998

25/12/1989 gives December 25, 1989

10/8/2011 gives Augber 9, 2011

8/5/1957 gives Maust 6, 1957

9/12/2012 (oddly enough) gives September 10, 2012

1/1/2000 gives January 1, 2000
Mathematica 341 304 298 288 293 bytes
This uses a pure or anonymous function, that is, a function without its own name.
DateString returns an error message if the date is ambiguous. Checkcatches the ambiguity and sends the offending date to DateList, which transforms it into list of 3 integers (which it believes to be {year, month, day}). The month and day integers are sorted by size and used to determine the month and day as per the OP's instructions.
Quiet silences error printing.
t=StringSplit;v=ToString;x=t[#,&quot;-&quot;]&amp;/@t[&quot;Janu-ary Febr-uary Mar-ch Apr-il Ma-y Ju-ne Ju-ly Aug-ust Septe-mber Octo-ber Nove-mber Dece-mber&quot;];
Quiet@Check[#~DateString~{&quot;MonthName&quot;,&quot; &quot;,&quot;DayShort&quot;,&quot;, &quot;,&quot;Year&quot;},
{m,n,o}=DateList@#;{p,q}=Sort@d[[2;;3]];x[[p,1]]&lt;&gt;x[[q,2]]&lt;&gt;&quot; &quot;&lt;&gt;v@Floor@Mean@{n,o}&lt;&gt;&quot;, &quot;&lt;&gt;v@d[[1]]]&amp;


t=StringSplit;v=ToString;x=t[#,&quot;-&quot;]&amp;/@t[&quot;Janu-ary Febr-uary Mar-ch Apr-il Ma-y Ju-ne Ju-ly Aug-ust Septe-mber Octo-ber Nove-mber Dece-mber&quot;];
Quiet@Check[#~DateString~{&quot;MonthName&quot;,&quot; &quot;,&quot;DayShort&quot;,&quot;, &quot;,&quot;Year&quot;},
{m,n,o}=DateList@#;{p,q}=Sort@d[[2;;3]];x[[p,1]]&lt;&gt;x[[q,2]]&lt;&gt;&quot; &quot;&lt;&gt;v@Floor@Mean@{n,o}&lt;&gt;&quot;, &quot;&lt;&gt;v@d[[1]]]&amp; /@ 
{&quot;10/31/1998&quot;,&quot;25/12/1989&quot;, &quot;10/8/2011&quot;, &quot;8/5/1957&quot;, &quot;9/12/2012&quot;, &quot;1/1/2012&quot;}


{&quot;October 31, 1998&quot;, &quot;December 25, 1989&quot;, &quot;Augber 9, 2011&quot;, &quot;Maust 6,
1957&quot;, &quot;September 10, 2012&quot;, &quot;January 1, 2012&quot;}