Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-05 Thread Gnanakumar
> If you really want a flexible function for doing this, I suspect you could replicate the functionality of jquery's 'timeago' module in a stored proc relatively easily. http://timeago.yarp.com/ It is MIT licensed, so you can copy the logic without restriction.  It makes reference to being derivati

Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-04 Thread Samuel Gendler
On Thu, Aug 4, 2011 at 4:42 AM, Gnanakumar wrote: > Hi Amitabh, > > ** ** > > Yes, I already took a glance of the Date/Time functions. But what I’m > expecting is something more meaningful/user-friendly value to be returned > than from the actual return value of these functions available he

Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-04 Thread Charlie
Consider: SELECT (NOW() - '1-Aug-2011')::text || ' ago.' user_string; yields: "3 days 18:59:24.781174 ago." From: gna...@zoniac.com To: amitabhk...@gmail.com CC: pgsql-sql@postgresql.org Subject: Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-04 Thread Gnanakumar
postgresql.org Subject: Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP Have you looked into the date time functions already ? http://www.postgresql.org/docs/9.0/static/functions-datetime.html Amitabh Kant On Thu, Aug 4, 2011 at 1:24 PM, Gnanakumar wrote: Hi, Is there any

Re: [SQL] Calculating relative time/distance from CURRENT_TIMESTAMP

2011-08-04 Thread Amitabh Kant
Have you looked into the date time functions already ? http://www.postgresql.org/docs/9.0/static/functions-datetime.html Amitabh Kant On Thu, Aug 4, 2011 at 1:24 PM, Gnanakumar wrote: > Hi, > > Is there any built-in function/add-on module available in PostgreSQL, that > converts a given "time