OK, After doing type(item.now). I discovered that web2py is escaping my retrieved data from the database and converting everything into strings. And since prettydate() doesnt work on strings but datetime objects, it fails. For this prettydate to work in the views, I would have to import datetime and do datetime.datetime.strptime(item.now, [format]) in order to format the datetime object that has now being converted into a string back to a datetime object and then allow prettydate() to work its magic. The only problem I am having now is knowing the correct format to pass to the strptime() function as all I have used is raising this error: "2012-08-15 01:38:15.019797' does not match format '%Y, %m, %d, %H, %M, %S, %f'" I need help thanks
On Tuesday, August 14, 2012 11:57:45 PM UTC+1, Pystar wrote: > > It fails silently, it outputs nothing. > > On Tuesday, August 14, 2012 11:34:54 PM UTC+1, Anthony wrote: >> >> item.now is a field in my database whose default value is request.now. >> >> >> Yes, I understand, but can you report the error raised as well as >> checking the type of item.now? >> >> Anthony >> > --