Re: now() + integer, not rounded to whole day

From: jirinej(at)volny(dot)cz (JN)
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: now() + integer, not rounded to whole day
Date: 2004-10-25 09:27:01
Message-ID: 7e29a94a.0410250127.4b463df1@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

jirinej(at)volny(dot)cz (JN) wrote in message news:<7e29a94a(dot)0410220404(dot)314f4308(at)posting(dot)google(dot)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'))

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andrei Bintintan 2004-10-25 10:04:46 Re: sql
Previous Message Muhyiddin A.M Hayat 2004-10-25 08:49:51 Re: Cross tabulations