Answers for "AttributeError: type object 'datetime.datetime' has no attribute 'timedelta' datetime.timedelta(minutes=240)"

0

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()
Posted by: Guest on April-19-2021
0

AttributeError: type object 'datetime.datetime' has no attribute 'datetime'

>>> import datetime
>>> datetime
<module 'datetime' from '/usr/lib/python2.6/lib-dynload/datetime.so'>
>>> datetime.datetime(2001,5,1)
datetime.datetime(2001, 5, 1, 0, 0)
Posted by: Guest on October-15-2021

Code answers related to "AttributeError: type object 'datetime.datetime' has no attribute 'timedelta' datetime.timedelta(minutes=240)"

Python Answers by Framework

Browse Popular Code Answers by Language