def to_min(dt):
    """
    Converts a datetime to an int representation in minutes. To do the reverse
    use: min_to_datetime.

    Parameters
    ----------
    dt : datetime.datetime
        Represents a datetime in datetime"srs format.

    Returns
    -------
    int
        Represents minutes from.

    """

    # get an integer time slot from a datetime
    return int(
        (dt - dt.utcfromtimestamp(0)).total_seconds() / 60
    )