Re: extracting date FROM timestamp

From: Arjen van der Meijden <acmmailing(at)vulcanus(dot)its(dot)tudelft(dot)nl>
To: javier garcia - CEBAS <rn001(at)cebas(dot)csic(dot)es>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: extracting date FROM timestamp
Date: 2003-12-22 11:34:31
Message-ID: 3FE6D6C7.3020600@vulcanus.its.tudelft.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2003-12-22 11:34:51 Re: extracting date FROM timestamp
Previous Message Pavel Stehule 2003-12-22 11:25:50 Re: questions about tsearch2 (for czech language)