def datetime_to_iso(timestamp):
 return datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S').isoformat()

def datetime_to_iso ( timestamp ) : return datetime . strptime ( timestamp , '%Y-%m-%d %H:%M:%S' ) . isoformat ( )
parse a datatime string and returns a datetime in iso format .