In MySQL, the DATE_FORMAT()
function allows you to format the date and time.
Here’s an example:
SELECT DATE_FORMAT('2018-12-01', '%W, %d %M %Y');
Result:
Saturday, 01 December 2018
In this example, %W
is for the weekday name, %d
is for the day of the month, %M
is for Month, and %Y
is for Year. There are many more format specifiers available that enable you to specify a precise format for dates, as well as the time component.