def get_slot(datetime_sec, band):
    """
    Return IBP schedule time slot (0 ... 17) from given datetime_sec (second
    from UNIX time epoch) and band (14, 18, ..., 28) MHz value
    """
    time_xmit = 10  # sec (transmitting time length)
    n_slots = 18    # number of slots
    period_sched = n_slots * time_xmit

    slot_offset = {
        14: 0,
        18: 1,
        21: 2,
        24: 3,
        28: 4
    }

    timeslot_in_sched = int(datetime_sec % period_sched) / time_xmit
    return (timeslot_in_sched - slot_offset[band]) % n_slots