atetime.timedelta' object has no attribute 'hours' code example
Example: type object 'datetime.datetime' has no attribute 'timedelta'
# Use either
import datetime
datetime.datetime.timedelta()
# or
from datetime import datetime
datetime.timedelta()
# But do not use (as you currently are):
from datetime import datetime
datetime.datetime.timedelta()