from datetime import datetime


def convert_date_to_continuous_time(dt):
    """Converts date to continuous time. Each year is one unit.

    Parameters
    ----------
    dt : datetime object
        the date to convert

    Returns
    -------
    conti_date : `float`
        the date represented in years
    """
    year_length = datetime(dt.year, 12, 31).timetuple().tm_yday
    tt = dt.timetuple()

    return (dt.year +
            (tt.tm_yday - 1
             + dt.hour / 24
             + dt.minute / (24 * 60)
             + dt.second / (24 * 3600)) / float(year_length))