DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can trim seconds out of a timestamp in postgresql?

Want to trim seconds out of time value stored in #postgresql ?

Look here then:

In my postgresql I have the following table:

Name: mytable
---
id INT PRIMARY KEY,
time TIME WITHOUT TIME ZONE

And I select some info:

select id,time from mytable;

But I want the time to be formated without seconds. How I can do this?

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay