Re: time

From: "Tadej Kanizar" <Tadej(dot)Kanizar(at)sagit-server(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: time
Date: 2005-11-10 19:29:07
Message-ID: 003601c5e62d$06b09600$680aa8c0@Tadejnotebook
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

So I don't open a new thread..
I have a table with a column of type TIMESTAMP.
In output, I need to format it.. what's the best way to do it?
So, for instance, how could I format it so that it would output as YY-MM-DD
HH:MM?

Regards,
Tadej

-----Original Message-----
From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-owner(at)postgresql(dot)org]
On Behalf Of Tom Lane
Sent: 10. november 2005 20:14
To: Michael Fuhr
Cc: Rod Taylor; Judith Altamirano Figueroa; pgsql-sql(at)postgresql(dot)org
Subject: Re: [SQL] time

Michael Fuhr <mike(at)fuhr(dot)org> writes:
> Am I missing something? Is there a reason not to simply cast the
> timestamp value to time?

> test=> select now()::time;
> now
> -----------------
> 11:19:19.892125
> (1 row)

> test=> select cast(now() as time);
> now
> -----------------
> 11:19:19.892125
> (1 row)

I think the OP was trying to use the functional cast syntax
time(now())
which worked long ago, but has not since we added the
SQL-spec time precision syntax.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

In response to

  • Re: time at 2005-11-10 19:13:43 from Tom Lane

Responses

  • Re: time at 2005-11-10 21:30:09 from Michael Fuhr

Browse pgsql-sql by date

  From Date Subject
Next Message Joel Fradkin 2005-11-10 20:19:01 High level discussion for design of using ACL to retrieve Data
Previous Message Michael Fuhr 2005-11-10 19:22:39 Re: time