Validating original dates before Emscripten timestamp normalization
A valid output timestamp can hide an impossible date in the original input.
Parsing success is not calendar validity
Treat successful parsing and validity of the original calendar fields as separate conditions. A parser can normalize an impossible date into a timestamp within the accepted range. Date-quality checks therefore need the original string, not just the converted timestamp. [1, 2, 3]
The reported Emscripten behavior
The Arrow report describes Emscripten strptime normalizing examples such as 2/30/2000 and a seconds field of 60. It explicitly distinguishes a CI change that skips affected tests from a repair that restores rejection of invalid inputs. Platform behavior and test-suite status are different pieces of evidence. [1]
Preserve the input and the policy
Keep the raw string and decide validity under an approved calendar policy before normalization. Version the accepted formats, month lengths, leap-year rules and leap-second treatment together. A regex matching digits and separators cannot establish calendar validity. Send changed interpretations to the person authorized to correct the original record. [1, 3]
A narrowly defined calendar check
The illustrative policy accepts dates present in the ordinary calendar and does not roll impossible dates into another month. Under that policy, true validity for February 29, 2000 passes; false validity for February 30 fails. Truthound Core's RowLevelValidator can apply a callable implementing the external calendar rule. The author must supply that rule and its tests; Truthound does not replace libc parsing or choose a leap-second policy. [1, 2, 3]
Application conditions
Prepare raw_date_text, calendar_valid and normalized_timestamp from original input or an independent calendar control, aligned to the same run, file and key scope.
Alternatives
Run a parser with strict calendar validation first and preserve the original text.
Limitations
A regex checking date shape does not validate month lengths or leap-second policy. Truthound does not change the libc parser.
Evidence
- Event checked
- Subject checked
- Modified
