cant convert datetimetimedelta object to str implicitly
You are trying to convert a datetime.timedelta object to a string implicitly, which is not allowed. To convert a datetime.timedelta object to a string, you need to explicitly call the str() function on it.
For example:
import datetime
tdelta = datetime.timedelta(days=5, hours=3, minutes=30)
# Convert timedelta to string
tdelta_str = str(tdelta)
print(tdelta_str)
Output:
5 days, 3:30:00
In this example, the timedelta object tdelta is converted to a string tdelta_str using the str() function
原文地址: https://www.cveoy.top/t/topic/ieFm 著作权归作者所有。请勿转载和采集!