pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feednow() + integer, not rounded to whole day
3+ messages / 2 participants
[nested] [flat]
* now() + integer, not rounded to whole day
@ 2004-10-22 12:04 JN <jirinej@volny.cz>
2004-10-25 09:27 ` Re: now() + integer, not rounded to whole day JN <jirinej@volny.cz>
0 siblings, 1 reply; 3+ messages in thread
From: jirinej@volny.cz @ 2004-10-22 12:04 UTC (permalink / raw)
To: pgsql-sql
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.
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: now() + integer, not rounded to whole day
2004-10-22 12:04 now() + integer, not rounded to whole day JN <jirinej@volny.cz>
@ 2004-10-25 09:27 ` JN <jirinej@volny.cz>
2004-10-25 16:32 ` Re: now() + integer, not rounded to whole day Bruno Wolff III <bruno@wolff.to>
0 siblings, 1 reply; 3+ messages in thread
From: jirinej@volny.cz @ 2004-10-25 09:27 UTC (permalink / raw)
To: pgsql-sql
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'))
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: now() + integer, not rounded to whole day
2004-10-22 12:04 now() + integer, not rounded to whole day JN <jirinej@volny.cz>
2004-10-25 09:27 ` Re: now() + integer, not rounded to whole day JN <jirinej@volny.cz>
@ 2004-10-25 16:32 ` Bruno Wolff III <bruno@wolff.to>
0 siblings, 0 replies; 3+ messages in thread
From: Bruno Wolff III @ 2004-10-25 16:32 UTC (permalink / raw)
To: JN <jirinej@volny.cz>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2004-10-25 16:32 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 12:04 now() + integer, not rounded to whole day JN <jirinej@volny.cz>
2004-10-25 09:27 ` JN <jirinej@volny.cz>
2004-10-25 16:32 ` Bruno Wolff III <bruno@wolff.to>
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