0

I have a column which has the time stamp stored in epoch. I need to fetch the date from the epoch time stamp. For instance for epoch = 1552942715, I need to fetch the date as 1552867200. How can this be achieved?

Vasanti
  • 1,207
  • 2
  • 12
  • 24
  • 1
    Your question is very unclear. Please include a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) of what you have tried, and what you want to accomplish. – Marc Mar 19 '19 at 13:13

1 Answers1

0
create table test (epoch text NULL);

Create table sample where the column is text datatype.

select (epoch::int)::TIMESTAMPTZ from test;

If the column is of type int or any other number then just cast it to timestampz

sallu
  • 376
  • 1
  • 6