## Summary GNU `date` silently ignores unrecognized trailing word-tokens and parses the preceding number as an hour. `parse_datetime` errors out instead. Found by a `fuzz_date` run on `uutils/coreutils`. ## Reproduction ```console $ TZ=UTC /usr/bin/date -u -d '8j' '+%H:%M:%S' 08:00:00 $ echo $? 0 $ TZ=UTC target/debug/coreutils date -u -d '8j' '+%H:%M:%S' date: invalid date '8j' $ echo $? 1 $ TZ=UTC /usr/bin/date -u -d '8 j' '+%H:%M:%S' 08:00:00 $ TZ=UTC target/debug/coreutils date -u -d '8 j' '+%H:%M:%S' date: invalid date '8 j' ``` ## Test (in `uutils/coreutils` integration suite) ```rust #[test] fn test_date_ignores_unrecognized_trailing_tokens() { for input in ["8j", "8 j"] { new_ucmd!() .env("TZ", "UTC") .arg("-u") .arg("-d") .arg(input) .arg("+%H:%M:%S") .succeeds() .stdout_only("08:00:00\n"); } } ```
Activity
fix: silently ignore unrecognized trailing alphabetic tokens after pu…
fix: silently ignore unrecognized trailing alphabetic tokens after pu…
xtqqczze commentedon Oct 12, 2026
@anastygnome Could you clarify your plans for addressing this issue?
anastygnome commentedon Oct 12, 2026
I intend to back port the code here before removing it from uutils after parse_datetime gets a release
sylvestre commentedon Oct 12, 2026
i did a release yesterday :)
anastygnome commentedon Nov 8, 2026
@xtqqczze Is coming in the series of PR I intend to push.