Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id D7DB2B5DBF1 for ; Thu, 4 Aug 2011 05:06:48 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 06830-08 for ; Thu, 4 Aug 2011 08:06:38 +0000 (UTC) X-Greylist: delayed 00:05:56.501308 by SQLgrey-1.7.6 Received: from rs73.luxsci.com (rs73.luxsci.com [64.49.254.135]) by mail.postgresql.org (Postfix) with ESMTP id 9C970B5DC33 for ; Thu, 4 Aug 2011 05:06:37 -0300 (ADT) Received: from GNANAM (NSG-Static-233.156.72.182.airtel.in [182.72.156.233] (may be forged)) (authenticated bits=0) by rs73.luxsci.com (8.13.8/8.13.8) with ESMTP id p7480UIV010622; Thu, 4 Aug 2011 03:00:36 -0500 Reply-To: From: "Gnanakumar" To: Subject: Calculating relative time/distance from CURRENT_TIMESTAMP Date: Thu, 4 Aug 2011 13:24:39 +0530 Organization: Zoniac Software Private Limited Message-ID: <009301cc527b$c48690b0$4d93b210$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 thread-index: AcxSe8H2QUUOaGQtSI+h2lVo8iFPMQ== Content-Language: en-us X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/14 X-Sequence-Number: 35682 Hi, Is there any built-in function/add-on module available in PostgreSQL, that converts a given "timestamp"/"timestamptz" value into its relative distance from CURRENT_TIMESTAMP? For example, relative distance as today, yesterday, 5 minutes ago, 1 week ago, etc. Regards, Gnanam