0

I have MySQL DB and i am using following syntax to convert my datetime type in second

select UNIX_TIMESTAMP(created_at) as time_sec, blah..blah..

But now i have other postgresql DB which has timestamp with time zone type so how do i convert that time in second with my select query?

2018-04-18 18:27:48.96283+00 This is this format of timestamp in table which i want to convert in seconds

0

1 Answer 1

0

you can use

select extract(epoch from created_at) as time_sec from tsepok

db<>fiddle here

more docs here

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.