From: Oliver Smith <oliver@kfs.org>
To: pgsql-sql@postgresql.org
Subject: Re: [SQL] merging date and time
Date: Wed, 31 Mar 1999 17:16:11 +0100
Message-ID: <19990331171611.B12083@kfs.org> (raw)
In-Reply-To: <370246D0.4F395EE7@rice.edu>
References: <C1256745.004D28AB.00@csc.com>
<370246D0.4F395EE7@rice.edu>
On Wed, Mar 31, 1999 at 10:01:20AM -0600, Ross J. Reedstrom wrote:
> test=> create table t1 (d date, t text);
> CREATE
> test=> insert into t1 values('22-03-1999','14:45:27');
> INSERT 101293 1
> test=> select datetime(d+timespan(t)) from t1;
> datetime
> ----------------------------
> Mon Mar 22 14:45:27 1999 CST
> (1 row)
>
> test=> drop table t1;
> DROP
> test=>
Or more simply...
select ('22-03-1999'::date + '14:45:27'::timespan) as myDateTime;
mydatetime
----------------------------
Mon Mar 22 14:45:27 1999 GMT
(1 row)
--
If at first you don't succeed, skydiving is not for you...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: oliver@kfs.org
Subject: Re: [SQL] merging date and time
In-Reply-To: <19990331171611.B12083@kfs.org>
References: <C1256745.004D28AB.00@csc.com> <370246D0.4F395EE7@rice.edu> <19990331171611.B12083@kfs.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox