def METHOD_NAME(night=None, endhour=None):
    """
    Transforms a night and time into a YYYY-MM-DD[THH:MM[:SS]] time string Slurm can interpret. Correctly accounts for the fact
    that the night is defined starting at Noon on a given day.
    Args:
        night: str or int. In the form YYYMMDD, the night the jobs are being run.
        endhour: str or int. The number (between 0 and 24) of hours after midnight where you stop submitting jobs to the queue.
    Returns:
        str. String of the form YYYY-mm-ddTHH:MM:SS. Based on the given night and endhour
    """
    if night is None:
        night = what_night_is_it()
    if endhour is None:
        endhour = get_nightly_end_time()
    endhour = int(endhour)
    yester_timetup = time.strptime(f'{night}{endhour:02d}', '%Y%m%d%H')
    yester_sec = time.mktime(yester_timetup)
    ## If ending in the PM, then the defined night is the same as the day it took place
    ## If in the AM then it corresponds to the following day, which requires adding 24 hours to the time.
    if endhour > 12:
        today_sec = yester_sec
    else:
        one_day_in_seconds = 24 * 60 * 60
        today_sec = yester_sec + one_day_in_seconds
    today_timetup = time.localtime(today_sec)
    return nersc_format_datetime(today_timetup)