parameters: (fmt="%Y-%m-%dT%H:%M:%S.%f")
return_statement: return cvt_fn
docstring: Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
  
          Params -
           - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"})
  
          Example::
              dt_expr = pyparsing_common.iso8601_datetime.copy()
              dt_expr.setParseAction(pyparsing_common.convertToDatetime())
              print(dt_expr.parseString("1999-12-31T23:59:59.999"))
          prints::
              [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
docstring_summary: Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
docstring_tokens: Helper to create a parse action for converting parsed datetime string to Python datetime . datetime
function: def convertToDatetime(fmt="%Y-%m-%dT%H:%M:%S.%f"):
          """
          Helper to create a parse action for converting parsed datetime string to Python datetime.datetime
  
          Params -
           - fmt - format to be passed to datetime.strptime (default=C{"%Y-%m-%dT%H:%M:%S.%f"})
  
          Example::
              dt_expr = pyparsing_common.iso8601_datetime.copy()
              dt_expr.setParseAction(pyparsing_common.convertToDatetime())
              print(dt_expr.parseString("1999-12-31T23:59:59.999"))
          prints::
              [datetime.datetime(1999, 12, 31, 23, 59, 59, 999000)]
          """
          def cvt_fn(s,l,t):
              try:
                  return datetime.strptime(t[0], fmt)
              except ValueError as ve:
                  raise ParseException(s, l, str(ve))
          return cvt_fn
function_tokens: def convertToDatetime ( fmt = "%Y-%m-%dT%H:%M:%S.%f" ) : def cvt_fn ( s , l , t ) : try : return datetime . strptime ( t [ 0 ] , fmt ) except ValueError as ve : raise ParseException ( s , l , str ( ve ) ) return cvt_fn