I have gotten the following error:
type object \'datetime.datetime\' has no attribute \'datetime\'
On the following line:
<
You should really import the module into its own alias.
import datetime as dt
my_datetime = dt.datetime(year, month, day)
The above has the following benefits over the other solutions:
my_datetime instead of date reduces confusion since there is already a date in the datetime module (datetime.date).datetime) do not shadow each other.