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

Re: Adding a stored number of minutes to a stored time

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Rob Richardson" <Rob(dot)Richardson(at)rad-con(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Adding a stored number of minutes to a stored time
Date: 2011-03-28 13:28:40
Message-ID: 5123E213-3FBA-40C4-AD11-1E558975AD73@seespotcode.net (view raw or flat)
Thread:
Lists: pgsql-novice
On Mar 28, 2011, at 9:06, Rob Richardson wrote:

> Greetings!
> 
> 
> 
> All of the examples I can find for adding a number of minutes to a
> timestamp show the number of minutes being hard-coded in the query.  I
> have a table that has a column containing a starting time and another
> column containing the number of minutes until the process will be
> finished.  I want to add the starting time and the number of minutes to
> calculate the finish time.  How do I convert the minutes column from an
> int4 to an interval?  Or is there a different way I should do that?

select some_timestamp_value + int4_col * interval '1 minute'

Michael Glaesemann
grzm seespotcode net




In response to

Responses

pgsql-novice by date

Next:From: Rob RichardsonDate: 2011-03-28 13:36:11
Subject: Re: Adding a stored number of minutes to a stored time
Previous:From: Rob RichardsonDate: 2011-03-28 13:06:36
Subject: Adding a stored number of minutes to a stored time

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