Add to Claude

Guides · For agents

Convert mixed date formats to YYYY-MM-DD in a CSV

Tools: sift_fix_dry_run, sift_fix_apply, sift_fix_undoWorks with Claude Code

Ask your agent to run Sift's date_format fix with to set to YYYY-MM-DD and the day and month order your file uses. Every date it can read for certain is rewritten, and the rest are flagged, never guessed. In the test bookings file, 5 of 10 dates change and 3 are flagged.

Ask your agent

With Sift connected (setup takes three steps), paste this and swap in your own paths.

Use Sift with /path/to/rules.bookings.json on /path/to/bookings_export.csv. Dry run date_format on the arrival column, to YYYY-MM-DD, with order day_first. Tell me what would change and what was flagged, then apply it if I say yes, raising the limit to 50% for this job only.

Half the dates change, and this rules file keeps the usual limit: {"guardrails": {"stop_if_share_of_rows_changed_over": 0.2}}. So the dry run warns that Sift would stop, and an apply without a raise does stop. Asking for 50% for this job only (maxShareChanged) lets it through and leaves the rules file as it is.

What Sift sends back

Dates that would change5 of 10 (50%): 14/03/2026, 03/04/2026, 4 Apr 2026, 31/12/2026 and 7/7/2026
Flagged, left as they were3: 2026-04-05T15:00 (a time of day), 05/05/26 (a two-digit year) and 2026-02-30 (no such day)
Already YYYY-MM-DD1
Blank1
After applyA new file, a receipt and a changes-only file. The original is not touched.
After undoThe original rebuilt, matching byte for byte

With day_first, 03/04/2026 becomes 2026-04-03, the 3rd of April, and 7/7/2026 becomes 2026-07-07.

Why you give the order

A date like 03/04/2026 could be 3 April or 4 March. Without an order, Sift flags it with the reason day and month could be either way round: on the same file, 4 dates change and 4 are flagged. A date like 14/03/2026 can only be one way, so it changes either way.

Set order to day_first or month_first in the prompt, or once as date_order in the rules file. If your trouble is a CRM reading dd/mm as mm/dd on import, see CSV date format for a CRM import.

What to do next

Questions

Can it write a format other than YYYY-MM-DD?
Yes. Name it with to, such as DD/MM/YYYY, D MMM YYYY or MMMM D, YYYY.
Why is a date with a time flagged?
Because YYYY-MM-DD has no time in it, so rewriting would drop the time. Sift leaves it as written for you to decide.
Does it work on an Excel file?
Fixes work on CSV, which is what makes the undo exact. Save the sheet as CSV first, then point your agent at the CSV.

One file, no agent? Clean a file by hand in your browser, with nothing uploaded.

More guides

Guide CSV date format for a CRM import Guide Remove currency symbols from a CSV column Guide Fill blank cells in a CSV with a value