Re: Date Arithmetic in PL/pgSql - Mailing list pgsql-novice

From John DeSoi
Subject Re: Date Arithmetic in PL/pgSql
Date
Msg-id F3706A17-4BBD-4658-9CF3-BE1C6CDCE812@pgedit.com
Whole thread Raw
In response to Date Arithmetic in PL/pgSql  ("Lane Van Ingen" <lvaningen@esncc.com>)
Responses Re: Date Arithmetic in PL/pgSql
List pgsql-novice
On Aug 8, 2005, at 4:23 PM, Lane Van Ingen wrote:

> I am trying to do some simple date arithmetic. All I wanted to do
> is take a
> timestamp
> (example: 2005-08-08 16:15:30) without a timezone, and substract a
> computed
> number
> of minutes and seconds (such as 310 seconds) from it; keep running
> into
> problems.


select '2005-08-08 16:15:30'::timestamp - '310 seconds'::interval;
       ?column?
---------------------
2005-08-08 16:10:20
(1 row)



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


pgsql-novice by date:

Previous
From: "Lane Van Ingen"
Date:
Subject: Date Arithmetic in PL/pgSql
Next
From: Tom Lane
Date:
Subject: Re: Date Arithmetic in PL/pgSql