Doesn't support postgres timezone neither though :

Maybe this example could be added in the book :

import datetime
from gluon.tools import prettydate
db.table_name.field_name.represent = lambda value, row: prettydate(value
.replace(tzinfo=None), T) if value else T('N/A')


:)

The interresting part in red...

Richard



On Fri, Oct 18, 2013 at 1:44 PM, Richard Vézina <[email protected]
> wrote:

> Hello,
>
> Ok, I did see some thread with the name passed, but didn't know it was for
> that usage.
>
> Here example :
>
> http://web2py.com/books/default/chapter/29/14/other-recipes?search=prettydate
>
> I think, I will go with it...
>
> If you want you can include ago.py in contrib if it good enough...
>
> :)
>
> The orginal code is stated as Public Domain :
> https://bitbucket.org/russellballestrini/ago/src
>
> Richard
>
>
> On Fri, Oct 18, 2013 at 1:04 PM, Massimo Di Pierro <
> [email protected]> wrote:
>
>> There is also
>>
>> from gluon.tools import prettydate
>>
>>
>> On Friday, 18 October 2013 11:05:28 UTC-5, Richard wrote:
>>>
>>>
>>> Like the object!!
>>>
>>> Here :
>>> http://www.web2pyslices.com/**slice/show/1746/ago-for-**
>>> web2py-with-magic-t-human-**readable-timestamp<http://www.web2pyslices.com/slice/show/1746/ago-for-web2py-with-magic-t-human-readable-timestamp>
>>>
>>> Enjoy
>>>
>>> Richard
>>>
>>  --
>> Resources:
>> - http://web2py.com
>> - http://web2py.com/book (Documentation)
>> - http://github.com/web2py/web2py (Source code)
>> - https://code.google.com/p/web2py/issues/list (Report Issues)
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "web2py-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to