code: def serialize(self, dt):
          
          if dt is None:
              return str(dt)
          return dt.strftime(self.date_format)
docs: Converts the date to a string using the :py:attr:`~_DateParameterBase.date_format`.