def dateDiff(unit, ts1, ts2):
    """
    returns the time delta between ts1 and ts2 in the provided unit.
    Unit in: ['second','minute','hour','day']
    """
    elapsedTime = ts2 - ts1
    totalSeconds = elapsedTime.total_seconds()

    if unit in ["s", "sec", "second"]:
        return totalSeconds
    elif unit in ["mn", "min", "minute"]:
        return totalSeconds / 60
    elif unit in ["hr", "hour"]:
        return totalSeconds / 60 / 60
    elif unit in ["d", "day"]:
        return totalSeconds / 60 / 60 / 24