Re: Joining dates/times (was Re: Splitting Timestamps) - Mailing list pgsql-general

From Tom Lane
Subject Re: Joining dates/times (was Re: Splitting Timestamps)
Date
Msg-id 25707.1154275255@sss.pgh.pa.us
Whole thread Raw
In response to Joining dates/times (was Re: Splitting Timestamps)  (Ron Johnson <ron.l.johnson@cox.net>)
List 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 by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: Questions about update, delete, ctid...
Next
From: Tom Lane
Date:
Subject: Re: Questions about update, delete, ctid...