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 2C0113A4157 for ; Mon, 25 Oct 2004 17:22:14 +0100 (BST) 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 56016-01 for ; Mon, 25 Oct 2004 16:22:05 +0000 (GMT) Received: from wolff.to (wolff.to [66.93.249.74]) by svr1.postgresql.org (Postfix) with SMTP id AA9113A4148 for ; Mon, 25 Oct 2004 17:22:02 +0100 (BST) Received: (qmail 11221 invoked by uid 500); 25 Oct 2004 16:32:50 -0000 Date: Mon, 25 Oct 2004 11:32:50 -0500 From: Bruno Wolff III To: JN Cc: pgsql-sql@postgresql.org Subject: Re: now() + integer, not rounded to whole day Message-ID: <20041025163250.GA11043@wolff.to> Mail-Followup-To: JN , pgsql-sql@postgresql.org References: <7e29a94a.0410220404.314f4308@posting.google.com> <7e29a94a.0410250127.4b463df1@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e29a94a.0410250127.4b463df1@posting.google.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/180 X-Sequence-Number: 19283 On Mon, Oct 25, 2004 at 02:27:01 -0700, JN wrote: > jirinej@volny.cz (JN) wrote in message news:<7e29a94a.0410220404.314f4308@posting.google.com>... > > Is it possible to add some portion of the day to now() ? I cannot > > round now() to whole days like now()::date. Hours, minutes and seconds > > are also important to me. This I had in Oracle, and need to convert it > > : > > > > sysdate + 1/1440 > > > > Thanks for any suggestion. > > It's simpler than I thought > > now() + (TO_TIMESTAMP('1970-01-01 00:01:00', 'yyyy-mm-dd HH24:MI:SS') > - TO_TIMESTAMP('1970-01-01 00:00:00', 'yyyy-mm-dd HH24:MI:SS')) You probably wanted to do something like: now() + '1 hour'::interval