DATE() in MySQL

Last Updated : 14 Aug, 2026

The DATE() function in MySQL extracts the date part from a DATE or DATETIME expression. It is useful when you want to work with the date separately from the time.

  • Extracts only the date from a DATETIME value.
  • Returns the date in YYYY-MM-DD format.
  • Removes the time portion from a datetime value.
  • Can be used with date and datetime values.

Syntax

DATE(date_expression);

Where:

  • date_expression: The date or datetime value from which the date needs to be extracted.

Example

SELECT DATE('2026-08-13 10:30:45') AS date_value;

Output:

Screenshot-2026-08-13-165007

DATE() with Table

Consider an orders table:

Screenshot-2026-08-13-165500

To extract only the date from order_date:

SELECT order_id, DATE(order_date) AS order_date
FROM orders;

Output:

Screenshot-2026-08-13-165754
  • The DATE() function removes the time portion from order_date and returns only the date.
Comment

Explore