Time without seconds

Started by Andreas Kraftlover 17 years ago2 messagesgeneral
Jump to latest
#1Andreas Kraftl
andreas.kraftl@kraftl.at

Hello,

is it possible to get the time without the seconds and without the usage
of a formatting function?

Example:
CREATE TABLE test.testtime
(
thetime time without time zone
);
INSERT INTO test.testtime (thetime) VALUES ('12:34:56');
INSERT INTO test.testtime (thetime) VALUES ('23:45');
SELECT thetime from test.testtime;
The result should be without the seconds.

I know that there are formatting functions for date/time. But I am
searching for a way to get a formatted time with a simple SQL query.

Thanks
Andreas

#2Grzegorz Jaśkiewicz
gryzman@gmail.com
In reply to: Andreas Kraftl (#1)
Re: Time without seconds

On Tue, Dec 2, 2008 at 10:37 AM, Andreas Kraftl
<andreas.kraftl@kraftl.at> wrote:

Hello,

is it possible to get the time without the seconds and without the usage

of a formatting function?

regexp and/or date_trunc

--
GJ