Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 6E7C8475BA0 for ; Fri, 22 Nov 2002 13:34:54 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 0A0F1475A09 for ; Fri, 22 Nov 2002 13:34:54 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id E019443A582; Fri, 22 Nov 2002 13:34:53 -0500 (EST) From: Jeff Boes X-Newsgroups: comp.databases.postgresql.sql Subject: Re: calculating interval Date: Fri, 22 Nov 2002 13:34:57 -0500 Organization: Nexcerpt, Inc. Lines: 27 Message-ID: References: <20021122142609.11784.qmail@webmail31.rediffmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@news.hub.org User-Agent: Pan/0.11.4 (Unix) X-Comment-To: "praveen vejandla" To: pgsql-sql@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200211/347 X-Sequence-Number: 10489 On Fri, 22 Nov 2002 09:26:31 -0500, praveen vejandla wrote: > Dear All, > > Is there any way in postgresql to calculate the interval between two > times excluding specific days,specific duration. > > Ex: > timestamp1 : 2002-10-01 10:30AM > timestamp2 : 2002-15-01 04:50PM > > suppose if i need the difference between timestamp1,timestamp2 but i > don't want to count how many sun days are coming, i want to ignore all > sundays in between,i want to ignore certain timings(say 10.00 AM to > 5:00PM)s also,then how can I get the duration in this way. > The easiest way would be to write a function in a language that supports some kind of date library. I'm most familiar with Perl and its Date::Manip library, so that's what I would turn to. -- Jeff Boes vox 616.226.9550 ext 24 Database Engineer fax 616.349.9076 Nexcerpt, Inc. http://www.nexcerpt.com ...Nexcerpt... Extend your Expertise