code: def stringToDate(fmt="%Y-%m-%d"):
      
      import time
      import datetime
      def conv_func(s):
          return datetime.date(*time.strptime(s,fmt)[:3])
      return conv_func
docs: returns a function to convert a string to a datetime.date instance
      using the formatting string fmt as in time.strftime