import time
timestamp=time.time()
request.session['current time']= timestamp
import datetime
datetime.datetime.fromtimestamp(request.session['current time'])
On Fri, Aug 3, 2018 at 7:56 PM, Julio Biason <julio.biason@azion.com> wrote:
Hi Anusha,It seems you're trying to generate a JSON of some object/dictionary with a Datetime in it. Datetimes are not serializable 'cause there is no date/time representation in JSON (maybe epoch, but that's not the default).----On Fri, Aug 3, 2018 at 11:18 AM, Anusha Kommineni <anushakommineni999@gmail.com> wrote:--Hi,I am getting below error.Can anyone help me?TypeError: datetime.datetime(2018, 2, 12, 0, 0, tzinfo=<UTC>) is not JSON serializable
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACBpiKjjH6Wh .tHfc%3DqLzQ7v5Dc7jDNuAmkRnzB4k b9rzE_Rr1Q%40mail.gmail.com
For more options, visit https://groups.google.com/d/optout .
Julio Biason, Sofware EngineerAZION | Deliver. Accelerate. Protect.Office: +55 51 3083 8101 | Mobile: +55 51 99907 0554
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com .
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users .
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/ .CAEM7gE0KV4kLbOnb2Eeinohpa%3D_ F3MmF7cuo%2BH0N_gYKxG_78g% 40mail.gmail.com
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMMZq8PcK1Eh7%2B_jR%3DtOnXP4gYSTU%3D4Bz4XUs8K9cizbrYGpBg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment