MySQL Database

MySQL Dates

Store, compare, and format dates and times.

SELECT order_date
FROM orders
WHERE order_date >= '2026-01-01'
  AND order_date < '2027-01-01';

Use DATE for calendar dates and DATETIME or TIMESTAMP when time matters. Prefer half-open ranges for date-time filtering.