Re: Q: timestamp - timestamp - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Q: timestamp - timestamp
Date
Msg-id 200305011116.21630.josh@agliodbs.com
Whole thread Raw
In response to Q: timestamp - timestamp  (Sepp Rudel <sepprudel@yahoo.com>)
List pgsql-novice
Sepp,

> this must be a no-brainer but I just can't get this
> working: I'd like to substract one timestamp from
> another and have the result as integer/seconds, e.g.:
>
> 2003-04-28 14:10:00+01 - 2003-04-28 14:00:00+01

SELECT extract(epoch FROM '2003-04-28 14:10:00+01'::timestamptz) -
extract(epoch FROM '2003-04-28 14:00:00+01'::timestamptz)

--
-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________
                                        Josh Berkus
   Complete information technology     josh@agliodbs.com
    and data management solutions     (415) 565-7293
   for law firms, small businesses      fax 621-2533
    and non-profit organizations.     San Francisco


pgsql-novice by date:

Previous
From: Sergey Holod
Date:
Subject: Making "SECURITY DEFINER" procedures
Next
From: eurlix
Date:
Subject: Re: Optimizing POSTGRESQL config