pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedQuestion 2 Interval and timestamptz
3+ messages / 2 participants
[nested] [flat]
* Question 2 Interval and timestamptz
@ 2008-03-26 16:05 Shawn <postgres@xmtservices.net>
0 siblings, 0 replies; 3+ messages in thread
From: Shawn @ 2008-03-26 16:05 UTC (permalink / raw)
To: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* FW: Re: Question 2 Interval and timestamptz
@ 2008-03-26 16:33 Adrian Klaver <aklaver@comcast.net>
0 siblings, 0 replies; 3+ messages in thread
From: aklaver@comcast.net @ 2008-03-26 16:33 UTC (permalink / raw)
To: pgsql-sql
-------------- Forwarded Message: --------------
From: aklaver@comcast.net (Adrian Klaver)
To: Shawn <postgres@xmtservices.net>
Subject: Re: [SQL] Question 2 Interval and timestamptz
Date: Wed, 26 Mar 2008 16:24:39 +0000
>
> -------------- Original message ----------------------
> From: Shawn <postgres@xmtservices.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@comcast.net
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Question 2 Interval and timestamptz
@ 2008-03-26 16:34 Shawn <postgres@xmtservices.net>
0 siblings, 0 replies; 3+ messages in thread
From: Shawn @ 2008-03-26 16:34 UTC (permalink / raw)
To: pgsql-sql
Awesome Adrian!
Thanks! Just what I needed.....
On Wednesday 26 March 2008 16:24:34 you wrote:
> -------------- Original message ----------------------
> From: Shawn <postgres@xmtservices.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@comcast.net
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2008-03-26 16:34 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2008-03-26 16:05 Question 2 Interval and timestamptz Shawn <postgres@xmtservices.net>
2008-03-26 16:33 FW: Re: Question 2 Interval and timestamptz Adrian Klaver <aklaver@comcast.net>
2008-03-26 16:34 Re: Question 2 Interval and timestamptz Shawn <postgres@xmtservices.net>
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