Compute the difference between two days.
Perl 5.14, score = -162
-163 -181 -196 -214 -167 -213 -234

code.length = 211: 208 source characters + 3 for running perl with the -p option
bonus = 5.5: default, order, year 0, never-valid month/day, invalid date, wholly-invalid input

Code
$_=eval(join'-',map{($y,$m,$d)=/(....)(..)(..)/;die&quot;E\n&quot;if!($m*$d)||$m&gt;12||$d&gt;30+($m&amp;1^$m&gt;7)-($m==2)*(2-!($y=~s/00$//r%4));$y-=($m&lt;3)-400;$d+int(($m+9)%12*30.6+.4)+int(365.2425*$y)}/^(\d{8})[ ,-](\d{8})$/)//E

Calculates a modified Julian day number for each date (ignoring the epoch-related adjustments to save code length) and subtracts the two. (ref. &quot;Julian Day&quot; at Wikipedia).

requires perl 5.14+ for the /r option on the substitutions
month-length calculation to get the invalid date bonus: the 30+($m&amp;1^$m&gt;7) part gives the length of any month but February; the rest adjusts for February in an ordinary or leap year

Assumptions

&quot;use Gregorian calendar&quot; means the proleptic Gregorian calendar for dates before whichever Julian to Gregorian transition we're using.  That is, don't subtract 11 days for intervals that cross, for example, the 3 Sep 1752 - 14 Sep 1752 British transition.
&quot;handle year 0&quot; means, for example, 00000101-00010101 should give 366, as 0 is an integral multiple of 400, and so year 0 is a leap year.