开发者

How to convert mssql datetime to mysql datetime

How can i convert this Feb 23 2011 9:00AM to this in mysql 2011-02-23 00:09:00 ? is there any built in function available in my开发者_C百科sql?


You can try with:

SELECT DATE_FORMAT( STR_TO_DATE('Feb 23 2011 9:00AM', '%b %d %Y %l:%i%p'), '%Y-%m-%d %H:%i:%s' );


If you have problems with convertind MSSQL Date (i got dates in integer) there is a simple solution to convert this integer to MySQL date

FROM_DAYS(DOC_DATE+693961)

693961 is a number of days from 1900-01-01.

Hope it would help someone

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜