def calculate_time_duration(start, end):
    """
    calculate how long between two times

    Args:
        start(datetime.datetime): the start time
        end(datetime.datetime): the end time

    Returns:
        duration(dict): dict containing the duration in days, hours,
                        minutes and seconds
    """
    timediff = end - start
    totalseconds = timediff.total_seconds()
    days, remainder = divmod(totalseconds, 86400)
    hours, remainder = divmod(remainder, 3600)
    minutes, seconds = divmod(remainder, 60)
    duration = {
        'days': days, 'hours': hours, 'minutes': minutes,
        'seconds': int(seconds)}
    return duration