1
How to convert a date into varchar
for datetime
in the mysql?
For example:
04-12-2016
for 2016-12-04 16:00:00
04/12/2016
for 2016-12-04 16:00:00
1
How to convert a date into varchar
for datetime
in the mysql?
For example:
04-12-2016
for 2016-12-04 16:00:00
04/12/2016
for 2016-12-04 16:00:00
2
Bar(/
):
SELECT str_to_date('06/01/2017 18:26','%m/%d/%Y %H:%i');
With the dash(-
):
SELECT data(str_to_date('06/01/2017 18:26', '%c/%e/%Y %H:%i'), '%Y-%m-%d %H:%m:%s')
The update would look like this: update conta_payment set dt_payment = date(str_to_date(dt_payment, '%c/%e/%Y'), '%Y-%m-%d %H:%m:%s'); ?????
@Paulocosta, yes.
Browser other questions tagged mysql
You are not signed in. Login or sign up in order to post.
Possible duplicate of Change Varchar field to Date Mysql
– Bacco