timedelta to int minutes code example
Example 1: python convert datetime.timedelta into seconds
a_timedelta = datetime.timedelta(seconds=24*60*60)
timedelta_seconds = a_timedelta.total_seconds()
print(timedelta_seconds)
OUTPUT
86400.0
Example 2: extract minutes from timedelta python
seconds = duration.total_seconds()
hours = seconds // 3600
minutes = (seconds % 3600) // 60
seconds = seconds % 60