我可以在MySQL中的"DD-Mon-YY"中插入日期吗?格式"? [英] Can i insert date in mySQL in "DD-Mon-YY" format"?
本文介绍了我可以在MySQL中的"DD-Mon-YY"中插入日期吗?格式"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
MySQL默认情况下支持此格式YYYY-MM-DD. 但是,如果我想在mysql中以"dd-Mon-yyyy"格式插入日期该怎么办? 有什么方法可以让我以这种格式插入手动日期.有任何想法的人吗?
Mysql support this format YYYY-MM-DD by default. But what if i want to insert date in this format "dd-Mon-yyyy" in mysql?? Is there any way so that i can insert the manual date in this format.Anyone having any idea??
如果可能,请写下插入语句.
If possible please write down the insert statement.
推荐答案
Yes using MySql STRING_TO_DATE() function
insert into your_table(date_column) values(STR_TO_DATE("09-Sep-2014","%d-%b-%Y"));
这篇关于我可以在MySQL中的"DD-Mon-YY"中插入日期吗?格式"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文