How to use date_trunc in PostgreSQL to truncate to 100 milliseconds?

The function date_trunc

uses a millisecond or second field, but the millisecond is too small for me and the second is too large. I want something in between 100 milliseconds (1/10 of a second).

How can I achieve this in PostgreSQL?

+3


source to share


1 answer


I think you can do it with conversion. The following should give you tenths of a second:



select cast(datecol as timestamp(1))

      

+5


source







All Articles