如何在PHP中将MSSQL转换为MySQL日期

时间:2015-06-09 17:44:48

标签: mysql sql-server

我是一名PHP开发人员,我正致力于在转换数据时将MSSQL转换为MySQL文件

while ( appIsRunning ) {
    handleEvents();

    update( deltaTime );

    render();

    // If frames were 30, wait 33 ms before running the loop again
    delay( 1000/frames ); 
}

我无法将其转换为CAST(0x063A0B00 AS Date)

1 个答案:

答案 0 :(得分:0)

SELECT 
      CAST(
          '1900-01-01 00:00:00' + 
          INTERVAL CAST(CONV(substr(HEX(BinaryData),1,8), 16, 10)  AS SIGNED) DAY +
          INTERVAL CAST(CONV(substr(HEX(BinaryData),9,8), 16, 10)  AS SIGNED)* 10000/3 MICROSECOND
      AS DATETIME) AS converted_datetime
FROM
(
SELECT 0x0000987C00000000 AS BinaryData
UNION ALL
SELECT 0x00009E85013711EE AS BinaryData
) d

来自how to cast the hexadecimal to varchar(datetime)?