CURRENT_TIMESTAMP in milliseconds

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

    The correct way of extracting miliseconds from a timestamp value on PostgreSQL accordingly to current documentation is:

    SELECT date_part('milliseconds', current_timestamp);
    
    --OR
    
    SELECT EXTRACT(MILLISECONDS FROM current_timestamp);
    

    with returns: The seconds field, including fractional parts, multiplied by 1000. Note that this includes full seconds.

提交回复
热议问题