from datetime import datetime


def determine_filename(date_time):
    """
    Determine the name to use for a logfile. Rounds to nearest 15 minutes.

    Format: yyyy_jjj_hh_mm.txt
    """
    minutes = [0, 15, 30, 45]
    minute_idx = date_time.minute // 15
    date_time = date_time.replace(minutes[minute_idx])
    return datetime.strftime(date_time, '%Y_%j_%H_%M.txt')