开发者

How to convert mssql datetime to mysql datetime

开发者 https://www.devze.com 2023-04-02 20:39 出处:网络
How can i convert this Feb 23 20119: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:

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

精彩评论

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