From: Bruno Wolff III <bruno@wolff.to>
To: JN <jirinej@volny.cz>
Cc: pgsql-sql@postgresql.org
Subject: Re: now() + integer, not rounded to whole day
Date: Mon, 25 Oct 2004 11:32:50 -0500
Message-ID: <20041025163250.GA11043@wolff.to> (raw)
In-Reply-To: <7e29a94a.0410250127.4b463df1@posting.google.com>
References: <7e29a94a.0410220404.314f4308@posting.google.com>
<7e29a94a.0410250127.4b463df1@posting.google.com>
On Mon, Oct 25, 2004 at 02:27:01 -0700,
JN <jirinej@volny.cz> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: bruno@wolff.to, jirinej@volny.cz
Subject: Re: now() + integer, not rounded to whole day
In-Reply-To: <20041025163250.GA11043@wolff.to>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox