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 7F0543A3D05 for ; Mon, 25 Oct 2004 10:51:39 +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 16115-08 for ; Mon, 25 Oct 2004 09:51:32 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id BFF333A3CC4 for ; Mon, 25 Oct 2004 10:51:34 +0100 (BST) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.12.9/8.12.9) with ESMTP id i9P9pVJ7021519 for ; Mon, 25 Oct 2004 09:51:31 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.12.9/8.12.9/Submit) id i9P9QxcQ014426 for pgsql-sql@postgresql.org; Mon, 25 Oct 2004 09:26:59 GMT From: jirinej@volny.cz (JN) X-Newsgroups: comp.databases.postgresql.sql Subject: Re: now() + integer, not rounded to whole day Date: 25 Oct 2004 02:27:01 -0700 Organization: http://groups.google.com Lines: 14 Message-ID: <7e29a94a.0410250127.4b463df1@posting.google.com> References: <7e29a94a.0410220404.314f4308@posting.google.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-sql@postgresql.org 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/174 X-Sequence-Number: 19277 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'))