from datetime import datetime


def adjust_subtitle(st, td):
    """
    Gets a list representing a subtitle. It expects the 'classic' .srt format
    with hours in the time stamps as the 2nd element of the list. Will then
    adjust the start and stop time by the given time delta object.

    :param st: The list containing the subtitle
    :param td: The timedelta object which is used to adjust
    :return: The processed list, although it is modified in-place.
    """
    # we only know microseconds, though the timestamp has milliseconds ...
    markers = [x + "000" for x in st[1].split(" --> ")]
    marker_objs = [datetime.strptime(x, "%H:%M:%S,%f") + td for x in markers]
    st[1] = "{} --> {}".format(
        marker_objs[0].strftime("%H:%M:%S,%f")[:-3],
        marker_objs[1].strftime("%H:%M:%S,%f")[:-3]
    )
    return st