CURRENT_TIMESTAMP in milliseconds

后端 未结 19 906
失恋的感觉
失恋的感觉 2020-12-07 23:48

Is there any way to get milliseconds out of a timestamp in MySql or PostgreSql (or others just out of curiosity)?

SELECT CURRENT_TI         


        
19条回答
  •  自闭症患者
    2020-12-08 00:46

    For MySQL (5.6+) you can do this:

    SELECT ROUND(UNIX_TIMESTAMP(CURTIME(4)) * 1000)
    

    Which will return (e.g.):

    1420998416685 --milliseconds
    

提交回复
热议问题