在mySql数据库表中更改日期格式 [英] Change date format in mySql database table
本文介绍了在mySql数据库表中更改日期格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select date_format(curdate(),'%d /%m /%Y');
,但它不会更新我的表中的现有数据。有任何容易这样做吗或者即使它不容易,可以给我一些建议如何做,请谢谢。解决方案
尝试使用
SELECT DATE_FORMAT(dateColumn,'%d /%m /%Y' )AS dateColumn FROM table
Morning everyone. Just a quick question. In my existing MySql database I've few columns with dates in it. Currently these are yyyy-mm-dd format but now I need to change it all to dd-mm-yyyy format. I've tried select date_format(curdate(), '%d/%m/%Y');
but it doesnt update existing data in my table.Is there any easy way of doing it? Or even if its not easy could you give me some suggestion how to do it please and thank you.
解决方案
Try using
SELECT DATE_FORMAT(dateColumn,'%d/%m/%Y') AS dateColumn FROM table
这篇关于在mySql数据库表中更改日期格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文