Write your own Death Note Kira needs your help!



Input format:

Date [and/or Time]
Name
Gender
Reason


Output format:

&lt;Last Name, First Name&gt; &lt;will die/died&gt; on the &lt;DD&gt;&lt;st/nd/rd/th&gt; of &lt;MMM, YYYY&gt; [at &lt;hh:mm:ss TT&gt;].
&lt;He/She&gt; &lt;will die/died&gt; of &lt;Reason&gt;.






Details, Details:



Your program should account for at least the following date input formats:

9 November 2003
9/11/2003
November 9, 2003




Time formats:

hh tt
hh TT
hh:mm tt
hh:mm TT
hh:mm:ss tt
hh:mm:ss TT
HH
HH:mm
HH:mm:ss




The following name input formats:

first        // Stephen
last         // Harper
first last   // Stephen Harper
last, first  // Harper, Stephen






Test cases:



Input:

2 September 1973
J.R.R. Tolkien
Male
pneumonia


Output:


  Tolkien, J.R.R. died on the 2nd of
  September, 1973.
  
  He died of pneumonia.




DISCLAIMER: If he actually dies on this date, it's Kira's fault, not mine.

UPDATE: Stephen Harper did not die on the listed date

Input:

21/12/12 23:59:59             // DD/MM/YY HH:mm:ss
Harper, Stephen               // Last, First
Unknown                       // Gender
a heart attack for no reason  // Reason


Output:


  Harper, Stephen will die on the 21st
  of December, 2012 at 11:59:59 PM.
  
  Harper, Stephen will die of a heart
  attack for no reason.






Bonus:

July 21, 1969 02:56:15 GMT
Armstrong, Neil
Male
poisoned moon cheese

--

January 19, 2038 03:14:08 GMT
Everyone
Unknown
Y2K38


Add &lt;st/nd/rd/th&gt; at the end of DD for input.
Javascript (561)

This can probably be reduced significantly, but here goes:

i=i.split("\n");d=new Date(i[0]);t=d.getDate();z=t%10;t+=z==1?"st":z==2?"nd":z==3?"rd":"th";m=['January','February','March','April','May','June','July','August','September','October','November','December'][d.getMonth()];y=d.getFullYear();a=d.getHours();b=d.getMinutes();c=d.getSeconds();l=a&amp;&amp;b&amp;&amp;c?" at "+a+":"+b+":"+c:"";g=d&gt;new Date()?"will die":"died";n=i[1].split(" ");n[1]?n[0][n[0].length-1]==","?n=i[1]:n=n[1]+", "+n[0]:n[0];s=i[2]=="Male"?"He":i[2]=="Female"?"She":n;document.write(n+" "+g+" on the "+t+" of "+m+", "+y+l+".&lt;br&gt;"+s+" "+g+" of "+i[3]+".");


Sample I/O:

2 September 1973
J.R.R. Tolkien
Male
pneumonia



  Tolkien, J.R.R. died on the 2nd of September, 1973.
  He died of pneumonia.


January 19, 2038 03:14:08 GMT
Everyone
Unknown
Y2K38



  Everyone will die on the 18th of January, 2038 at 21:14:8.
  Everyone will die of Y2K38.


Try it out on JsFiddle.