import time


def timestr_unix(time_str):
    """
    transfer formatted timestamp to unix time.

    Args:
        time_str (str): formated time string.

    Returns:
        int: unix time.
    """
    time_format_with_hill = '%Y-%m-%dT%H:%M:%S.%f%z'

    time_str = time_str[:26] + time_str[-6:]
    time_format = time.strptime(time_str, time_format_with_hill)
    return int(time.mktime(time_format))