Pavithira Ganason
Pavithira Ganason

Reputation: 3

how to convert string datetime to timestamp in postgreSQL

I have data in a column of string type value.

For example : string value : 20201123043000 i need to get timestamp value : 2020-11-23 04:30:00

How can i write sql query to get above timestamp. Thanks

Upvotes: 0

Views: 290

Answers (1)

Barbaros Özhan
Barbaros Özhan

Reputation: 65228

You can use TO_TIMESTAMP function

SELECT TO_TIMESTAMP('20201123043000','YYYYMMDDHHMISS');

Upvotes: 2

Related Questions