Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 200E6475F7B for ; Fri, 8 Nov 2002 13:49:34 -0500 (EST) Received: from wolff.to (unknown [66.93.197.35]) by postgresql.org (Postfix) with SMTP id 65EEF475EB9 for ; Fri, 8 Nov 2002 13:49:33 -0500 (EST) Received: (qmail 7551 invoked by uid 500); 8 Nov 2002 18:59:10 -0000 Date: Fri, 8 Nov 2002 12:59:10 -0600 From: Bruno Wolff III To: Roberto Mello Cc: pgsql-sql@postgresql.org Subject: Re: Time difference without intervals Message-ID: <20021108185910.GA7364@wolff.to> Mail-Followup-To: Roberto Mello , pgsql-sql@postgresql.org References: <20021108182002.GC25961@cc.usu.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021108182002.GC25961@cc.usu.edu> User-Agent: Mutt/1.3.25i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/143 X-Sequence-Number: 10285 On Fri, Nov 08, 2002 at 11:20:02 -0700, Roberto Mello wrote: > > Is there any way to make a timestamp difference operation not return an > interval? I'd like to get hours, minutes and seconds only, not the "1 day" > or whatnot. When you take a difference of two timestamps, you are going to get an interval that does not have a year, month difference component. You can get the interval value in seconds by using extract(epoch from interval). You can then further manipulate this value to get hours, minutes and seconds.