9

How do I convert a Unix timestamp (or epoch time) to a PostgreSQL timestamp without time zone?

For example, 1481294792 should convert to 2016-12-09 14:46:32.

I tried SELECT to_timestamp(1481294792)::timestamp, but that gives me 2016-12-09 09:46:32.

1 Answer 1

17
SELECT to_timestamp(1481294792) AT TIME ZONE 'UTC';

Source: https://dba.stackexchange.com/a/61345/33877

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.