Re: Rounding datetimes

From: "Peter Childs" <peterachilds(at)gmail(dot)com>
To:
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Rounding datetimes
Date: 2007-05-22 17:20:40
Message-ID: a2de01dd0705221020u676a867t3863a7af36d3dfd0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 22 May 2007 10:08:24 -0700, jws <jsacksteder(at)gmail(dot)com> wrote:
>
> Is there a way to round an interval to the nearest minute or do I need
> to create a function for this?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>

date_trunc('minute',interval)

see

http://www.postgresql.org/docs/8.2/interactive/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC

Peter Childs

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Robert Fitzpatrick 2007-05-22 17:23:35 Re: Permance issues with migrated db
Previous Message sudhir 2007-05-22 17:20:33 Re: Lock table, Select for update and Serialization error