Re: Date Arithmetic in PL/pgSql

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Lane Van Ingen <lvaningen(at)esncc(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Date Arithmetic in PL/pgSql
Date: 2005-08-08 20:45:07
Message-ID: F3706A17-4BBD-4658-9CF3-BE1C6CDCE812@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2005-08-08 21:09:29 Re: Date Arithmetic in PL/pgSql
Previous Message Lane Van Ingen 2005-08-08 20:23:02 Date Arithmetic in PL/pgSql