from datetime import datetime


def _time_of_day(dt: datetime) -> float:
    """Convert a given datetime `dt` to a point on the unit circle, where the 'period' corresponds to one day.

    :param datetime.datetime dt: input datetime UTC
    :returns: `float` between 0 and 1 corresponding to the phase
    """
    midnight = dt.replace(hour=0, minute=0, second=0, microsecond=0)
    seconds_since_midnight = (dt - midnight).total_seconds()
    return seconds_since_midnight / 86400