# Date Column Validator

Check every value in one CSV date column against a chosen format — ISO, US, EU, RFC 3339, or a custom pattern — with a per-row report of invalid dates.

## Run it

- **CLI:** `gizza tool date-column-validate "name,joined
Ada,2021-06-01
Bo,2021/06/02
Cy,2021-13-40" 'column=joined'`
- **Web:** https://gizza.ai/tools/date-column-validate/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/date-column-validate/tool.json

## Inputs

- `data` — CSV data _(field)_
- `column` — Column (name or 0-based index) _(field)_
- `preset` — Date format _(field)_
- `format` — Custom pattern (preset = Custom) _(field)_
- `has_header` — First row is a header _(field)_
- `allow_blank` — Allow blank cells _(field)_
- `delimiter` — Delimiter _(field)_
- `max_issues` — Max issues to list _(field)_
- `output` — Output format _(field)_

## Output

- Validation report (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `data` — CSV data
- `column` — Column (name or 0-based index)
- `preset` — Date format
- `format` — Custom pattern (preset = Custom)
- `has_header` — First row is a header
- `allow_blank` — Allow blank cells
- `delimiter` — Delimiter
- `max_issues` — Max issues to list
- `output` — Output format

Example: `https://gizza.ai/tools/date-column-validate/?data=name%2Cjoined%0AAda%2C2021-06-01%0ABo%2C2021%2F06%2F02%0ACy%2C2021-13-40&column=joined&preset=iso-date&format=%25d-%25b-%25Y&has_header=true&allow_blank=true&delimiter=auto&max_issues=50&output=text`

---

## About this tool

**Date Column Validator** checks that every value in one CSV date column parses against a date format you choose, and reports the exact rows that do not. It is useful before importing spreadsheets, partner exports, or analytics feeds into a system that expects a strict date format.

Pick the column by header name (for example `joined`) or by 0-based index (for example `1` for the second column), choose a format, and run. The report shows how many values were checked, how many are valid, how many are invalid, and — for each offending cell — its data-row number, its line number in the original text, the value, and why it failed.

### Formats you can check against

- **ISO date** — `YYYY-MM-DD`, such as `2021-06-01` (the default).
- **US date** — `MM/DD/YYYY`, such as `06/15/2021`.
- **EU date** — `DD/MM/YYYY`, such as `15/06/2021`.
- **ISO date-time** — `YYYY-MM-DDThh:mm:ss`, such as `2021-06-01T12:30:00`.
- **RFC 3339** — a full date-time with offset, such as `2021-06-01T12:30:00Z`.
- **Custom pattern** — any chrono/strftime pattern in the Custom pattern field, such as `%d-%b-%Y` for `01-Jun-2021`, `%Y%m%d` for `20210601`, or `%H:%M:%S` for a time of day.

Common specifiers for a custom pattern: `%Y` four-digit year, `%m` month, `%d` day, `%b` short month name, `%H:%M:%S` time.

### Worked example

Input data:

```csv
name,joined
Ada,2021-06-01
Bo,2021/06/02
Cy,2021-13-40
```

Column `joined`, format **ISO date**. The report checks 3 rows, marks 2 valid and 2 invalid: row 2 `2021/06/02` uses slashes instead of dashes, and row 3 `2021-13-40` is not a real calendar date (month 13, day 40). Impossible calendar dates — month 13, February 30, bad leap days like `2021-02-29` — are rejected, not just badly shaped strings.

CLI example:

```bash
gizza tool date-column-validate data="name,joined
Ada,2021-06-01
Bo,2021/06/02" column=joined preset=iso-date has_header=true allow_blank=true delimiter=auto max_issues=50 output=text
```

### Limits and edge cases

The parser handles quoted fields, doubled quotes, delimiters inside quotes, quoted newlines, and blank physical lines. It auto-detects comma, tab, semicolon, and pipe delimiters from the first non-blank line, or you can set the delimiter yourself. Blank cells count as valid by default; turn off **Allow blank cells** to flag them. The invalid list is capped by **Max issues to list** (1–1000) so large files stay readable, but the summary always reports the full invalid count. This tool validates one date column at a time and does not fix, reformat, or convert values — it is a report-only checker.

## FAQ

<details>
<summary>How do I validate a CSV that has no header row?</summary>

Turn off **First row is a header** and refer to the column by 0-based index. For example, `0` is the first column and `1` is the second. A numeric value in the Column field is always read as a 0-based index, even when a header is present.

</details>

<details>
<summary>What date formats can I check against?</summary>

Presets cover ISO `YYYY-MM-DD`, US `MM/DD/YYYY`, EU `DD/MM/YYYY`, ISO date-time `YYYY-MM-DDThh:mm:ss`, and full RFC 3339. For anything else, choose **Custom pattern** and supply a chrono/strftime pattern such as `%d-%b-%Y`, `%Y%m%d`, or `%H:%M:%S`.

</details>

<details>
<summary>Does it catch impossible dates like February 30?</summary>

Yes. Values are parsed as real calendar dates, so month `13`, day `40`, `2021-02-30`, and a non-leap `2021-02-29` are all reported as invalid even though they have the right shape.

</details>

<details>
<summary>Are blank cells treated as valid?</summary>

By default, yes — blank cells are skipped and counted as valid. Turn off **Allow blank cells** to report every blank cell in the column as invalid instead.

</details>

<details>
<summary>Why does the report list fewer invalid rows than the invalid count?</summary>

The listed rows are capped by **Max issues to list** (1–1000, default 50) so a large file stays readable. The summary's Invalid count is never capped, so it always reflects the true total; raise the cap to list more offending rows.

</details>

## Related tools

- [Check a CSV column against an allowed set of values](https://gizza.ai/tools/enum-domain-check/): Check one CSV column against allowed categories and flag out-of-set values with counts, row locations, blank handling, and text or JSON reports.
- [CSV Column Type Validator](https://gizza.ai/tools/csv-column-type-validator/): Validate CSV columns against declared types like int, float, bool, date, and enum, with row/line reports for every offending cell.
- [Find incomplete CSV rows](https://gizza.ai/tools/csv-find-incomplete-rows/): Scan a CSV for malformed rows: too few or too many fields, or blank cells in required columns. Runs in your browser. Free, private, no upload.
- [Validate a CSV column with a regex](https://gizza.ai/tools/regex-column-validate/): Validate one CSV column against a regex, with header or index selection, delimiter auto-detect, blank handling, inverted matching, and text or JSON reports.
- [Date / Time Parser](https://gizza.ai/tools/parse-datetime/): Parse a date or time in almost any format — ISO 8601, RFC 2822, US/European dates — into year, month, day, weekday, ISO week and a canonical ISO 8601 value.
