Re: Splitting Timestamps

Поиск
Список
Период
Сортировка
От Curtis Scheer
Тема Re: Splitting Timestamps
Дата
Msg-id 031936836C46D611BB1B00508BE7345D0491734D@gatekeeper.daycos.com
обсуждение исходный текст
Ответ на Splitting Timestamps  ("Chris Hoover" <revoohc@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "A. Kretschmer"
Дата:
Сообщение: Re: Splitting Timestamps
Следующее
От: Christian Schoenebeck
Дата:
Сообщение: Re: CASE statement and SETOF values