Re: datetime(): Where is it in the docs? - Mailing list pgsql-general

From Jean-Christian Imbeault
Subject Re: datetime(): Where is it in the docs?
Date
Msg-id 3D899D20.7010206@mega-bucks.co.jp
Whole thread Raw
In response to datetime(): Where is it in the docs?  (Jean-Christian Imbeault <jc@mega-bucks.co.jp>)
List 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


pgsql-general by date:

Previous
From: Jean-Christian Imbeault
Date:
Subject: Re: IN vs EXIIST
Next
From: Jean-Christian Imbeault
Date:
Subject: Re: IN vs EXIIST