Re: Question 2 Interval and timestamptz

From: Shawn <postgres(at)xmtservices(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Question 2 Interval and timestamptz
Date: 2008-03-26 16:34:22
Message-ID: 200803261634.22435.postgres@xmtservices.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Awesome Adrian!

Thanks! Just what I needed.....

On Wednesday 26 March 2008 16:24:34 you wrote:
> -------------- 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)
>
> --
> Adrian Klaver
> aklaver(at)comcast(dot)net

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2008-03-26 17:14:28 Re: FW: Re: Part 1 of several - Converting a varchar to an interval
Previous Message Adrian Klaver 2008-03-26 16:33:42 FW: Re: Question 2 Interval and timestamptz