SQL: DATE_FORMAT()
10 September 2023 (Updated 27 April 2025)
On this page
In a nutshell
The DATE_FORMAT() function lets you format a date value based on a format string.
Syntax
DATE_FORMAT(date, format)
date: The date or datetime value to format.format: The format string that defines the output format. This string can contain special date format specifiers that start with the%character.
Example
SELECT DATE_FORMAT('1993-07-12', '%W, %D %M %Y');
# Monday, 12th July 1993
- DATE_FORMAT() – MySQL docs
- MySQL REPL – use this to play around with the different format specifiers.
Tagged:
SQL
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment