How To Change Date Format in MySQL Query?

Feb 08, 2022

.

Admin

Hi friends,

I am going to explain you example of how to change date format in MySQL query?. You will learn MySQL date format DD/MM/YYYY select query?. In side this article we will see the MySQL date format to convert dd.mm.yy to YYYY-MM-DD?.

This article will give you simple example of how to change datetime formats in MySQL. We will use get search MySQL DATE_FORMAT Function: Format Dates in MySQL.

So let's start following example.

Table : user_payments


Solution SQL Query : 1

SELECT

*, DATE_FORMAT(payment_date,'%d/%m/%Y') as new_payment_date

FROM `user_payments`

Output:

Solution SQL Query : 2

SELECT

*, DATE_FORMAT(payment_date,'%m/%d/%Y') as new_payment_date

FROM `user_payments`

Output:

I hope it will help you...

#MySQL