Tuesday, November 27, 2018

why created_at is greater than updated_at while inserting data in table

hello, i am using this code to update created_at and updated_at in models:
        created_at = models.DateTimeField(auto_now_add=True)
updated_at= models.DateTimeField(auto_now=True,null=True)

but however there is created _at is greater than updated_at when data is inserted: 

       created_at  -> 2018-11-26 11:11:30.020989
       updated_at -> 2018-11-26 11:11:30.019762

please help, thank you.

--
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/9b41f94a-63d9-4e6b-b0e0-f4056eb73fa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment