ONSdigital / csvw-check

A CLI to validate CSV-Ws (W3C's CSV on the Web standard).
Apache License 2.0
1 stars 1 forks source link

Handle exception while processing dateformat #72

Closed josepajay closed 3 years ago

josepajay commented 3 years ago

When an exception occurs in dateformats for datetime related datatypes, issue warnings and process as if no dare format pattern is provided.

josepajay commented 3 years ago
  1. yyyy-MM-ddTHH:mm:ss.S with one or more trailing S characters indicating the maximum number of fractional seconds e.g., yyyy-MM-ddTHH:mm:ss.SSS for 2015-03-15T15:02:37.143
  2. yyyy-MM-ddTHH:mm:ss e.g., 2015-03-15T15:02:37
  3. yyyy-MM-ddTHH:mm

As per W3C specification for CSV-W, datetime format patterns mentioned above should also be accepted. The SimpleDateFormat class does not recognise the time separator and thus these 3 formats are transformed to include the time separator (as a special char) https://www.w3.org/TR/2015/REC-tabular-data-model-20151217/#h-formats-for-dates-and-times