python timedelta to minutes code example
Example 1: extract minutes from timedelta python
seconds = duration.total_seconds()
hours = seconds // 3600
minutes = (seconds % 3600) // 60
seconds = seconds % 60
Example 2: python timedelta to seconds
import datetime
datetime.datetime.timestamp(datetime.timedelta(hours=1, days=2, seconds=1000)).total_seconds()