Re: Joining dates/times (was Re: Splitting Timestamps)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Joining dates/times (was Re: Splitting Timestamps)
Дата
Msg-id 25707.1154275255@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Joining dates/times (was Re: Splitting Timestamps)  (Ron Johnson <ron.l.johnson@cox.net>)
Список pgsql-general
Ron Johnson <ron.l.johnson@cox.net> writes:
> What's the inverse?  Say I have a DATE and a TIME, and want to
> create a TIMESTAMP with them?

Add 'em together, using the "date + time" or "date + timetz" operator:

regression=# select current_date + '11:57'::time;
      ?column?
---------------------
 2006-07-30 11:57:00
(1 row)

regression=# select current_date + '11:57-04'::timetz;
        ?column?
------------------------
 2006-07-30 11:57:00-04
(1 row)

See "Date/Time Operators" in the manual.  I believe these operations
are SQL-standard.

            regards, tom lane

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

Предыдущее
От: "Florian G. Pflug"
Дата:
Сообщение: Re: Questions about update, delete, ctid...
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Questions about update, delete, ctid...