def parse_datetime ( dt_str , format ) : t = time . strptime ( dt_str , format ) return datetime ( t [ 0 ] , t [ 1 ] , t [ 2 ] , t [ 3 ] , t [ 4 ] , t [ 5 ] , t [ 6 ] , pytz . UTC )
python datetime from string timezone
Create a timezone - aware datetime object from a datetime string .
def parse_datetime(dt_str, format):
    """Create a timezone-aware datetime object from a datetime string."""
    t = time.strptime(dt_str, format)
    return datetime(t[0], t[1], t[2], t[3], t[4], t[5], t[6], pytz.UTC)