[Answered ]-Access to the date details in a Django database

1👍

The reason behind this is q.pub_date is datetime object and it has the attribute called year in python, its the syntax that you can access the object attributes using dot(.) that’s why you have to write datetime_obj.year to get the year.

Leave a comment