CURRENT_TIMESTAMP in milliseconds

后端 未结 19 923
失恋的感觉
失恋的感觉 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:30

    To get the Unix timestamp in seconds in MySQL:

    select UNIX_TIMESTAMP();
    

    Details: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_unix-timestamp

    Not tested PostgreSQL, but according to this site it should work: http://www.raditha.com/postgres/timestamp.php

    select round( date_part( 'epoch', now() ) );
    

提交回复
热议问题