Parse a date of the form [+-]YYYY-MM-DD.
The year must contain at least 4 digits, to avoid the Y2K problem:
a two-digit year YY may mean YY, 19YY, or 20YY, and we make it
an error to prevent the ambiguity.
Years from 0000 to 0999 must thus be zero-padded.
The year may have more than 4 digits.