Fixes #38 : add an error message in case of an invalid date format. Add
2 unit tests.