from datetime import datetime
import calendar


def formatted_timestamp_utc_time(timestamp_str, format_str):
    """
    Converts a formatted timestamp timestamp string to UTC time
    NOTE: will not handle seconds >59 correctly due to limitation in
    datetime module.
    :param timestamp_str: a formatted timestamp string
    :param format_str: format string used to decode the timestamp_str
    :return: utc time value
    """

    dt = datetime.strptime(timestamp_str, format_str)

    return calendar.timegm(dt.timetuple()) + (dt.microsecond / 1000000.0)