A date literal in day-month or month-day order is read differently by session settings

tx0/sql:ambiguous-date-literalrecommendedwarningreliability/time-and-localedepth fastbug

What it finds

A date written as '01/02/2024' or '01-02-2024' is read as the first of February or the second of January depending on the language or date settings of the session. '2024-02-01' (or '20240201' in SQL Server) reads the same everywhere.

From the rule's source, ambiguous_date_literal.rs.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/sql:ambiguous-date-literal" = "warning"

To keep one finding, suppress it with a reason: tx0 suppress ID --reason "..." writes the comment for it.

tx0 explain tx0/sql:ambiguous-date-literal shows the same in the terminal. Found a false positive? Report it.