from datetime import datetime


def format_date_for_mongo(time_str):
    """
    Reformat a time string into YYYY-MM-ddTHH:mm:ss.
    """
    return datetime.strptime(time_str, '%y_%m_%d_%H_%M_%S')\
        .strftime('%Y-%m-%dT%H:%M:%S')