Re: Splitting Timestamps - Mailing list pgsql-general

From Curtis Scheer
Subject Re: Splitting Timestamps
Date
Msg-id 031936836C46D611BB1B00508BE7345D0491734D@gatekeeper.daycos.com
Whole thread Raw
In response to Splitting Timestamps  ("Chris Hoover" <revoohc@gmail.com>)
List pgsql-general

I believe you would want to cast the field to a date like so select datefield::datefrom table1 or select datefield::time from table1.

 


From: Chris Hoover [mailto:revoohc@gmail.com]
Sent: Tuesday, July 25, 2006 11:55 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Splitting Timestamps

 

I have several columns in my database that are timestamps.  My developers are asking me how to split the timestamp so that they can look at either the date or at the time portion.

I know I can do a select to_date(now(),'yyyy-mm-dd') and it will return the date.  However, how do I get the time?  Also, is this the proper way to get the date portion of a timestamp?

Thanks,

Chris

pgsql-general by date:

Previous
From: "A. Kretschmer"
Date:
Subject: Re: Splitting Timestamps
Next
From: Christian Schoenebeck
Date:
Subject: Re: CASE statement and SETOF values