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 A795456448 for ; Sat, 26 Feb 2005 20:10:04 +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 67628-10 for ; Sat, 26 Feb 2005 20:09:54 +0000 (GMT) Received: from vms042pub.verizon.net (vms042pub.verizon.net [206.46.252.42]) by svr1.postgresql.org (Postfix) with ESMTP id F23CE565A7 for ; Sat, 26 Feb 2005 20:10:00 +0000 (GMT) Received: from jfradkin ([66.15.127.235]) by vms042.mailsrvcs.net (Sun Java System Messaging Server 6.2 HotFix 0.04 (built Dec 24 2004)) with ESMTPA id <0ICJ005KMC0PFHF0@vms042.mailsrvcs.net> for pgsql-sql@postgresql.org; Sat, 26 Feb 2005 14:10:02 -0600 (CST) Date: Sat, 26 Feb 2005 15:14:02 -0500 From: "Joel Fradkin" Subject: Re: diference in dates in minutes In-reply-to: <20050226180108.GB26473@wolff.to> To: "'Bruno Wolff III'" Cc: Message-id: <000401c51c3f$b82188d0$797ba8c0@jfradkin> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.148 tagged_above=0 required=5 tests=AWL, MSGID_DOLLARS X-Spam-Level: *** X-Archive-Number: 200502/330 X-Sequence-Number: 20440 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. They are dates and I did find I could do date - date to give me an = interval=20 date_part('epoch',date-date) returns in secs so /60 This appeared to work ok without converting to time stamps, but maybe I = am missing it if it is not correct as the example I looked at was a large difference. The app is analyzing Tlogs and the difference should never = be too large, so I will further analyze it with real data. As always I appreciate the help. My real question is this an interval then and will it be depreciated = soon? If so what is a better way? Joel ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings