Use _safe_cast to avoid dying on illegal dates.
Merge pull request #614 from asutherland/survive-bad-dates

Return 0 dates instead of throwing on bad dates.