Skip site navigation (1) Skip section navigation (2)

FW: Re: Question 2 Interval and timestamptz

From: aklaver(at)comcast(dot)net (Adrian Klaver)
To: pgsql-sql(at)postgresql(dot)org
Subject: FW: Re: Question 2 Interval and timestamptz
Date: 2008-03-26 16:33:42
Message-ID: 032620081633.22111.47EA7AE6000358970000565F22007358349D0A900E04050E@comcast.net (view raw or flat)
Thread:
Lists: pgsql-sql
-------------- Forwarded Message: --------------
From: aklaver(at)comcast(dot)net (Adrian Klaver)
To: Shawn <postgres(at)xmtservices(dot)net>
Subject: Re: [SQL] Question 2 Interval and timestamptz
Date: Wed, 26 Mar 2008 16:24:39 +0000
> 
>  -------------- Original message ----------------------
> From: Shawn <postgres(at)xmtservices(dot)net>
> > Hello!
> > 
> > The second part of my question is:
> > 
> > Given a value as an interval, see previous posting, is there a simply method 
> > to take a given timestamptz value and a given interval value and create the 
> > sum or difference of the 2 in timestamptz format?
> > 
> > The scenario is that the afore mentioned tables, see previous post, in 
> > addition to the duration varchar field, also have a field called event_at_utc 
> > which is a timestamptz type.  I need to calculate the end time of the event 
> > given the interval calculated from the duration (varchar) field.
> > 
> > Any all all help is greatly appreciated.
> > 
> > Shawn
> > 
> 
> 
select '2008-03-26 09:21:44':: timestamptz + (('134987'::int/1000)* interval '1 
 second');
         ?column?
 ------------------------
  2008-03-26 09:23:58-07
 (1 row)

Forgot to Reply All. 
 --
 Adrian Klaver
 aklaver(at)comcast(dot)net


pgsql-sql by date

Next:From: ShawnDate: 2008-03-26 16:34:22
Subject: Re: Question 2 Interval and timestamptz
Previous:From: Adrian KlaverDate: 2008-03-26 16:32:34
Subject: FW: Re: Part 1 of several - Converting a varchar to an interval

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group