Re: Splitting Timestamps

Поиск
Список
Период
Сортировка
От A. Kretschmer
Тема Re: Splitting Timestamps
Дата
Msg-id 20060725171036.GA3890@webserv.wug-glas.de
обсуждение исходный текст
Ответ на Splitting Timestamps  ("Chris Hoover" <revoohc@gmail.com>)
Список pgsql-general
am  25.07.2006, um 12:54:35 -0400 mailte Chris Hoover folgendes:
> 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.

The CAST-Operater is your friend:

est=# select now();
              now
-------------------------------
 2006-07-25 19:12:36.744262+02
(1 row)

test=# select now()::time;
       now
-----------------
 19:12:41.803128
(1 row)

test=# select now()::date;
    now
------------
 2006-07-25
(1 row)

test=#


HTH, Andreas
--
Andreas Kretschmer    (Kontakt: siehe Header)
Heynitz:  035242/47215,      D1: 0160/7141639
GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net
 ===    Schollglas Unternehmensgruppe    ===

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Splitting Timestamps
Следующее
От: Curtis Scheer
Дата:
Сообщение: Re: Splitting Timestamps