def parse_tstamp(ev, field_name):
 try:
  return datetime.strptime(ev[field_name], '%Y-%m-%d %H:%M')
 except Exception as e:
  log.error(("Unable to parse the '%s' field in the event named '%s': %s" % (field_name, ev['title'], e)))
  raise

def parse_tstamp ( ev , field_name ) : try : return datetime . strptime ( ev [ field_name ] , '%Y-%m-%d %H:%M' ) except Exception as e : log . error ( ( "Unable to parse the '%s' field in the event named '%s': %s" % ( field_name , ev [ 'title' ] , e ) ) ) raise
parse a timestamp string in format "yyyy-mm-dd hh:mm" :returns: datetime .