def gettime(athlinkstime):
    """
    return epoch time based on athlinks time
    
    :param athlinkstime: time from athlinks record
    :rtype: int containing epoch time
    """
    while athlinkstime[0] not in '0123456789':
        athlinkstime = athlinkstime[1:]
    while athlinkstime[-1] not in '0123456789':
        athlinkstime = athlinkstime[:-1]
    return int(athlinkstime) / 1000
