Re: Timestamp to date conversion...plz help me - Mailing list pgsql-general

From Steve Crawford
Subject Re: Timestamp to date conversion...plz help me
Date
Msg-id 200310201025.45336.scrawford@pinpointresearch.com
Whole thread Raw
In response to Timestamp to date conversion...plz help me  ("Jitender Kumar C" <Jitender.Chakka@igate.com>)
List pgsql-general
You probably want either the extract, date_part, date_trunc or to_char
functions:

select extract('year' from now());
 date_part
-----------
      2003

select date_part('day', now());
 date_part
-----------
        20


select date_trunc('day',now());
       date_trunc
------------------------
 2003-10-20 00:00:00-07

select to_char(now(),'mm/dd/yyyy');
  to_char
------------
 10/20/2003

Cheers,
Steve


On Saturday 18 October 2003 9:41 am, Jitender Kumar C wrote:
> Hi,
>     I want to extract date part (mm/dd/yy or any other date format)
> of Timestamp in postgreSQL.  Can anyone help me out?.
>
>
>
>  Regards,
>  Ch.V.J. Kumar
>
> |Associate Consultant | iGATE Global Solutions Limited | Office:
> | 5521701 xtn  3031 | 9886219429|  Jitender.Chakka@igate.com


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: plpgsql
Next
From: "scott.marlowe"
Date:
Subject: Re: Recomended FS