在mysql中使用SELECT STR_TO_DATE()函数将字符串日期转为日期型: SELECT STR_TO_DATE('2012~8~8 14.58.09','%Y~%m~%d %k.%i.%s' ); STR_TO_DATE('2012-8-8 14:58:09','%Y-%m-%d %k:%i:%s' ) A;;STR_TO_DATE('2012+8+8 14:58:09','%Y+%m+%d %k:%i:%s' ) A;