Re: extracting date FROM timestamp - Mailing list pgsql-general

From Arjen van der Meijden
Subject Re: extracting date FROM timestamp
Date
Msg-id 3FE6D6C7.3020600@vulcanus.its.tudelft.nl
Whole thread Raw
In response to extracting date FROM timestamp  (javier garcia - CEBAS <rn001@cebas.csic.es>)
List pgsql-general
Javier,

Try casting, like so:
select current_timestamp::date;
(note, pgsql won't be able to use an index for a casted field)

Best regards,

Arjen

javier garcia - CEBAS wrote:
> Hi;
> Please. Could you tell me the more simple way to extract the 'date' part of a
> timestamp value.
> I guess we could extract the year, month, and day subfields and concatenate
> them. But, isn't there a more direct way?
>
> Best regards,
>
> Javier
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>




pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: questions about tsearch2 (for czech language)
Next
From: Pavel Stehule
Date:
Subject: Re: extracting date FROM timestamp