1

Is there any way to get total milliseconds from epoch time to now.

EXTRACT(EPOCH FROM TIMESTAMP '2011-05-17 10:40:28.876944')

The above query gives me number of seconds. What I want is number of milliseconds from epoch time.

EXTRACT(EPOCH FROM TIMESTAMP '2011-05-17 10:40:28.876944') * 1000

This code also doesn't give what I want, It is not actual number of milliseconds from epoch time. There is no function which can directly give me milliseconds from epoch time.

afzalex
  • 8,598
  • 2
  • 34
  • 61
  • [As documented in the manual](https://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-EXTRACT) `EXTRACT(EPOCH ...)` returns the number of **seconds** –  Jul 09 '18 at 07:48
  • @a_horse_with_no_name I got it. There is no function or way to get number of milliseconds from epoch time. – afzalex Jul 09 '18 at 07:57

0 Answers0