DATE_FORMAT() in MySQL — How It Works

What the MySQL DATE_FORMAT() function does, with an example.

Published October 19, 2026

DATE_FORMAT() formats a date value according to a specified format string.

Key points

  • Part of standard SQL functions available in MySQL for working with dates and times

Example

SELECT DATE_FORMAT(NOW(), '%Y-%m-%d');
More SQL articles