Re: Splitting Timestamps

From: Curtis Scheer <Curtis(at)DAYCOS(dot)com>
To: Chris Hoover <revoohc(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Splitting Timestamps
Date: 2006-07-25 17:12:42
Message-ID: 031936836C46D611BB1B00508BE7345D0491734D@gatekeeper.daycos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)gmail(dot)com]
Sent: Tuesday, July 25, 2006 11:55 AM
To: pgsql-general(at)postgresql(dot)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

Browse pgsql-general by date

  From Date Subject
Next Message Christian Schoenebeck 2006-07-25 17:42:08 Re: CASE statement and SETOF values
Previous Message A. Kretschmer 2006-07-25 17:10:36 Re: Splitting Timestamps