from datetime import datetime


def time_distance(time1, time2):
    """
    Calculates the time differences in Hours
    """
    time1 = datetime.strptime(time1, '%H:%M:%S').hour
    time2 = datetime.strptime(time2, '%H:%M:%S').hour    
    diff = abs(time1- time2)
    diff = diff if diff<=12 else 24 - diff
    return diff