Wednesday, November 28, 2018

Re: why created_at is greater than updated_at while inserting data in table

is there any fix to this?

On Wednesday, 28 November 2018 12:43:03 UTC+5:30, Ankit Khandewal wrote:
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/dd230d20-c51d-4497-b46d-d692086b1bdc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment