Re: datetime(): Where is it in the docs?

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: datetime(): Where is it in the docs?
Date: 2002-09-19 09:47:12
Message-ID: 3D899D20.7010206@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Henshall, Stuart - WCP wrote:
>
> datetime(x) casts x to type datetime.
> I think use of the datetime type is discouraged and timestamp encouraged.

Ok, so what is the encouraged and hopefully fast/efficient way of doing:

to_char(datetime(a_timestamp), 'MM-DD')

would it be to_char('a_timestamp'::timestamp, 'MM-DD') ?

Basically all I want to do is extract the month and day from a
timestamp. I'd used the EXTRACT functions but you can only extract one
part at a time ...

Jc

Browse pgsql-general by date

  From Date Subject
Next Message Joel Palmius 2002-09-19 09:53:25 "Custom" records?
Previous Message Jean-Christian Imbeault 2002-09-19 09:36:56 Re: IN vs EXIIST