def parse_runtime_duration(runtime):
    """Parse duration information from TransXChange runtime code"""
    HOUR_IN_SECONDS = 60 * 60
    MINUTE_IN_SECONDS = 60
    time = 0
    runtime = runtime.split('PT')[1]
    if 'H' in runtime:
        split = runtime.split('H')
        time = time + int(split[0]) * HOUR_IN_SECONDS
        runtime = split[1]
    if 'M' in runtime:
        split = runtime.split('M')
        time = time + int(split[0]) * MINUTE_IN_SECONDS
        runtime = split[1]
    if 'S' in runtime:
        split = runtime.split('S')
        time = time + int(split[0]) * MINUTE_IN_SECONDS
    return time
