Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 84AD42E0060 for ; Wed, 26 Mar 2008 13:34:30 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 99881-02-3 for ; Wed, 26 Mar 2008 13:34:23 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from mail.xmtservices.net (unknown [66.224.65.210]) by postgresql.org (Postfix) with SMTP id 543D32E0087 for ; Wed, 26 Mar 2008 13:34:24 -0300 (ADT) Received: (qmail 3119 invoked from network); 26 Mar 2008 16:34:22 -0000 Received: from unknown (HELO vaio.xmtservices.net) (192.168.0.101) by errol.xmtservices.net with SMTP; 26 Mar 2008 16:34:22 -0000 From: Shawn To: pgsql-sql@postgresql.org Subject: Re: Question 2 Interval and timestamptz Date: Wed, 26 Mar 2008 16:34:22 +0000 User-Agent: KMail/1.9.9 References: <032620081624.19276.47EA78C20004140000004B4C22058891169D0A900E04050E@comcast.net> In-Reply-To: <032620081624.19276.47EA78C20004140000004B4C22058891169D0A900E04050E@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200803261634.22435.postgres@xmtservices.net> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200803/178 X-Sequence-Number: 30506 Awesome Adrian! Thanks! Just what I needed..... On Wednesday 26 March 2008 16:24:34 you wrote: > -------------- Original message ---------------------- > From: Shawn > > > 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) > > -- > Adrian Klaver > aklaver@comcast.net