MYSQL: DATE_FORMAT() reference
10 September 2023 (Updated 10 September 2023)
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:
MySQL
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment