Re: extracting date FROM timestamp

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
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:51
Message-ID: Pine.LNX.4.44.0312221230550.27697-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

tsearch2=# select extract(day from current_timestamp);
date_part
-----------
22

or

tsearch2=# select to_char(timestamp 'now','YY DD MM HH12:MI:SS');
to_char
-------------------
03 22 12 12:28:46
(1 řádka)

Regards
Pavel

On Mon, 22 Dec 2003, 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 Arjen van der Meijden 2003-12-22 11:36:47 Re: Tables Referencing themselves As Foreign Keys
Previous Message Arjen van der Meijden 2003-12-22 11:34:31 Re: extracting date FROM timestamp