X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3C24456601 for ; Sat, 26 Feb 2005 17:45:44 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19024-05 for ; Sat, 26 Feb 2005 17:45:33 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id DFCB156609 for ; Sat, 26 Feb 2005 17:45:38 +0000 (GMT) Received: (qmail 30169 invoked by uid 500); 26 Feb 2005 18:01:08 -0000 Date: Sat, 26 Feb 2005 12:01:08 -0600 From: Bruno Wolff III To: Joel Fradkin Cc: pgsql-sql@postgresql.org Subject: Re: diference in dates in minutes Message-ID: <20050226180108.GB26473@wolff.to> Mail-Followup-To: Joel Fradkin , pgsql-sql@postgresql.org References: <007401c51ac0$f515b250$797ba8c0@jfradkin> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <007401c51ac0$f515b250$797ba8c0@jfradkin> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/326 X-Sequence-Number: 20436 On Thu, Feb 24, 2005 at 17:34:08 -0500, Joel Fradkin wrote: > Sorry for being redundant (I asked this a while back). > I was looking for in days before and used date math > Date1::date - date2::date returned the days which was fine for my original > question. > I did get a reply mentioning the age function and he mentioned I could get > minutes etc. > I looked up age in the docs and did not see it. > Anyone have a example of using it to get the minutes between two date > functions, or another method? You probably want to convert the dates to timestamps, subtract them to get an interval, extract the epoch to get timme in seconds and then divide by 60 to get time in minutes. The converting date to timestamp part isn't trivial. You need to decide on what you mean when you do this. If you really have timestamps in the first place, then you can skip the covernsion step.