Look for this in gluon/contrib/simplejson/encoder.py if isinstance(o, (datetime.date, datetime.datetime, datetime.time)): return o.isoformat()[:19].replace('T',' ') raise TypeError("%r is not JSON serializable" % (o,))
If it is not there something is wrong with your installation. Try download it again. On Jun 1, 1:59 pm, weheh <richard_gor...@verizon.net> wrote: > I tried it with 1.6.2.3 and it didn't work: TypeError: > datetime.datetime(2009, 6, 1, 0, 0) is not JSON serializable > > On May 24, 7:27 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > yes it does in the sense that you can serialize date,datetimeand > > time objects using web2py's simplejson but they are serialized into > > isostrings, not javascript date objects. Should they be serialized > > into javascript Date objects? pros? Cons? > > > Massimo > > > On May 24, 3:28 pm, weheh <richard_gor...@verizon.net> wrote: > > > > Massimo, are you saying that simplejson now supportsdatetime? If yes, > > > hallelujah! It's been a real pain converting all my datetimes in my > > > calendar program to strings, so this would simplify my code > > > considerably. > > > > On May 23, 1:57 am, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > forget it. I did it. > > > > > Massimo > > > > > On May 22, 2:35 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > > > can somebody figure out how to serialize in isoformat date and > > > > > datetimes in simplejson? > > > > > > I would include it in the new gluon/serialize.py/json > > > > > > Massimo- Hide quoted text - > > > > > - Show quoted text - > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---