Troubleshooting “descriptor ‘date’ requires a ‘datetime.datetime’ object but received a ‘int'”

It seems that you have imported datetime.datetime module instead of datetime. This should work though:

import datetime
currentdate = raw_input("Please enter todays date in the format dd/mm/yyyy: ")
day,month,year = currentdate.split("https://stackoverflow.com/")
today = datetime.date(int(year),int(month),int(day))

..or this:

from datetime import date
currentdate = raw_input("Please enter todays date in the format dd/mm/yyyy: ")
day,month,year = currentdate.split("https://stackoverflow.com/")
today = date(int(year),int(month),int(day))

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)