Re: [SQL] merging date and time - Mailing list pgsql-sql

From Oliver Smith
Subject Re: [SQL] merging date and time
Date
Msg-id 19990331171611.B12083@kfs.org
Whole thread Raw
In response to Re: [SQL] merging date and time  ("Ross J. Reedstrom" <reedstrm@rice.edu>)
Responses Retrieving the record not matched with a join.
List pgsql-sql
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...


pgsql-sql by date:

Previous
From: "Ross J. Reedstrom"
Date:
Subject: Re: [SQL] merging date and time
Next
From: "Jackson, DeJuan"
Date:
Subject: RE: [SQL] Odd "problem", not sure if there is a solution ....