Dalitos
Dalitos

Reputation: 109

Convert to_timestamp in postgreSQL

Lets do the following:

SELECT to_timestamp(1453336500)::date

Then i get a date 2016-01-21

How does the function work backwards. With the date as input and the number (i guess seconds from 1970) as result?

Upvotes: 0

Views: 48

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246073

You use extract:

SELECT extract(epoch FROM current_timestamp);

Upvotes: 1

Related Questions