10๐
โ
By using from datetime import datetime, timedelta
you have imported the datetime type from the datetime module. Thus when you call datetime.date
you are calling a method on the datetime type.
I think what you want is to use the date type from the datetime module:
- Change your import to
from datetime import datetime, timedelta, date
. - Call
date(year, month, 1)
instead ofdatetime.date(year, month, 1)
.
๐คBrenBarn
Source:stackexchange.com