def timestamp_to_datetime(timestamp):
 ts = datetime.datetime.strptime(timestamp[:(-10)], '%Y-%m-%dT%H:%M:%S')
 tz_hours = int(timestamp[(-5):(-3)])
 tz_mins = (int(timestamp[(-2):]) * int((timestamp[(-6):(-5)] + '1')))
 tz_delta = datetime.timedelta(hours=tz_hours, minutes=tz_mins)
 return (ts + tz_delta)

def timestamp_to_datetime ( timestamp ) : ts = datetime . datetime . strptime ( timestamp [ : ( - 10 ) ] , '%Y-%m-%dT%H:%M:%S' ) tz_hours = int ( timestamp [ ( - 5 ) : ( - 3 ) ] ) tz_mins = ( int ( timestamp [ ( - 2 ) : ] ) * int ( ( timestamp [ ( - 6 ) : ( - 5 ) ] + '1' ) ) ) tz_delta = datetime . timedelta ( hours = tz_hours , minutes = tz_mins ) return ( ts + tz_delta )
converts a utc timestamp to a datetime .