def parseTimestamp(s):
 s = s.strip()
 for pattern in DATETIME_FORMATS:
  try:
   return datetime.datetime.strptime(s, pattern)
  except ValueError:
   pass
 raise ValueError(('The provided timestamp %s is malformed. The supported formats are: [%s]' % (s, ', '.join(DATETIME_FORMATS))))

def parseTimestamp ( s ) : s = s . strip ( ) for pattern in DATETIME_FORMATS : try : return datetime . datetime . strptime ( s , pattern ) except ValueError : pass raise ValueError ( ( 'The provided timestamp %s is malformed. The supported formats are: [%s]' % ( s , ', ' . join ( DATETIME_FORMATS ) ) ) )
parses a textual datetime format and return a python datetime object .