{"record":{"id":"b5c1f69773fc2d9f","repo":"quickwit-oss/quickwit","slug":"failed-to-parse-date-option-parameter-s","errorCode":null,"errorMessage":"failed to parse --{}-date option parameter `{}`. supported format is `YYYY-MM-DD[ HH:DD[:SS]]`","messagePattern":"failed to parse --(.+?)-date option parameter `(.+?)`\\. supported format is `YYYY-MM-DD\\[ HH:DD\\[:SS\\]\\]`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"quickwit/quickwit-cli/src/split.rs","lineNumber":438,"sourceCode":"\nfn parse_date(date_arg: &str, option_name: &str) -> anyhow::Result<OffsetDateTime> {\n    let description = format_description::parse_borrowed::<2>(\"[year]-[month]-[day]\")?;\n    if let Ok(date) = Date::parse(date_arg, &description) {\n        return Ok(date.with_hms(0, 0, 0)?.assume_utc());\n    }\n\n    for datetime_format in [\n        \"[year]-[month]-[day] [hour]:[minute]\",\n        \"[year]-[month]-[day] [hour]:[minute]:[second]\",\n        \"[year]-[month]-[day]T[hour]:[minute]\",\n        \"[year]-[month]-[day]T[hour]:[minute]:[second]\",\n    ] {\n        let description = format_description::parse_borrowed::<2>(datetime_format)?;\n        if let Ok(datetime) = PrimitiveDateTime::parse(date_arg, &description) {\n            return Ok(datetime.assume_utc());\n        }\n    }\n    bail!(\n        \"failed to parse --{}-date option parameter `{}`. supported format is `YYYY-MM-DD[ \\\n         HH:DD[:SS]]`\",\n        option_name,\n        date_arg\n    );\n}\n\nfn parse_split_state(split_state_arg: &str) -> anyhow::Result<SplitState> {\n    let split_state = match split_state_arg.to_lowercase().as_str() {\n        \"staged\" => SplitState::Staged,\n        \"published\" => SplitState::Published,\n        \"marked\" => SplitState::MarkedForDeletion,\n        _ => bail!(format!(\n            \"unknown split state `{split_state_arg}`. possible values are `staged`, `published`, \\\n             and `marked`\"\n        )),\n    };\n    Ok(split_state)","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/quickwit-oss/quickwit/blob/a39730c5cdcd1a4fe798403737ae293999ea21f8/quickwit/quickwit-cli/src/split.rs#L420-L456","documentation":"`quickwit split list` accepts `--start-date`/`--end-date` (option_name interpolated) filters parsed with a small set of fixed `time` crate format descriptions: `YYYY-MM-DD`, `YYYY-MM-DD HH:DD`, or `YYYY-MM-DD HH:DD:SS`, interpreted as UTC. A value that does not parse under any of these formats bails with this error naming the offending option and string.","triggerScenarios":"Passing a date that is ISO-8601-with-T (`2024-01-01T10:00:00`), includes timezone offsets (`2024-01-01T10:00:00Z`), epoch millis (`1704067200`), or slash-formatted dates (`01/01/2024`) to `--start-date` or `--end-date` on `quickwit split list`.","commonSituations":"Copy-pasting RFC3339/ISO timestamps from logs or APIs (with `T` and `Z`) into the CLI; using Unix epoch values from monitoring dashboards; locale-formatted dates; forgetting that the separator must be a space, not `T`.","solutions":["Rewrite the value as `YYYY-MM-DD`, e.g. `--start-date 2024-01-01`.","If a time is needed, use `YYYY-MM-DD HH:DD` or `YYYY-MM-DD HH:DD:SS` with a space separator, e.g. `--end-date \"2024-01-01 10:30:00\"`.","Drop timezone suffixes (`Z`, `+00:00`) and `T` separators; values are assumed UTC.","Convert epoch timestamps to UTC wall-clock form before passing them."],"exampleFix":"// before\nquickwit split list --index my-index --start-date 2024-01-01T00:00:00Z\n// after\nquickwit split list --index my-index --start-date \"2024-01-01 00:00:00\"","handlingStrategy":"validation","validationCode":"const DATE_RE = /^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}(:\\d{2})?)?$/;\nfunction validateSplitListDate(value: string): string | null {\n  return DATE_RE.test(value) ? null : `use YYYY-MM-DD[ HH:DD[:SS]], got: ${value}`;\n}","typeGuard":"function isQuickwitDate(v: string): boolean {\n  return /^\\d{4}-\\d{2}-\\d{2}( \\d{2}:\\d{2}(:\\d{2})?)?$/.test(v);\n}","tryCatchPattern":"// Match the parse failure and normalize to the accepted format before retrying\nconst res = await run(cmd);\nif (res.code === 1 && /failed to parse --.*-date option/.test(res.stderr)) {\n  const normalized = rawDate.replace(\"T\", \" \").replace(/(Z|[+-]\\d{2}:?\\d{2})$/, \"\").slice(0, 19);\n  return run(cmd.replace(rawDate, normalized));\n}","preventionTips":["Always emit dates as `YYYY-MM-DD HH:MM:SS` UTC when generating CLI commands.","Strip `T` separators, `Z`, and timezone offsets before passing dates to Quickwit.","Convert epoch timestamps to UTC date strings in the producing script.","Quote date arguments containing spaces in shell scripts."],"tags":["cli","date-parsing","quickwit"],"backgroundTag":"invalid-date-format","analyzedSha":"a39730c5cdcd1a4fe798403737ae293999ea21f8","analyzedAt":"2026-09-08T13:19:37.784Z","contentChangedAt":"2026-09-08T13:19:37.784Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}