Search code examples
postgresqlpgadmin

Can change the time format in postgresql?


Is it possible to somehow change the time format in postgresql? At the moment I have the format time without time zone and it is displayed hh:mm:ss, and how can I make it in hh:mm?


Solution

  • The display format of date, time and timestamp values can be changed with to_char function:

    SELECT to_char(current_timestamp, 'HH:MI') -- or HH24:MI if want 24 hours