Python Dates and Times in Python Dates and Times Timedelta Minute

Anders Tellefsen
Anders Tellefsen
9,896 Points

Don't know why my code isn't working

Hi, I am unable to figure out why my code isn't working as it should. Thanks for any help:)
import datetime
import math

def minutes(dt1, dt2):
    totalsec1 = dt1.datetime.timedelta.total_seconds() / 60
    totalsec2 = dt2.datetime.timedelta.total_seconds() / 60

    return math.round(totalsec2 - totalsec1)