Skip to content
Advertisement

From HH:MI:SS to HH:MI in postgresql

I’m trying to do a query where the input is an hour in the HH24:MI:SS format, I want to return HH12:MI format, I tried the following:

But it’s returning me this

How could I fix it?

Advertisement

Answer

You want to_char(), not to_timestamp():

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement