code: def to_iso_date(self, dt):
          
          if dt is None:
              return ""
          if isinstance(dt, DateTime):
              return dt.ISO8601()
          if isinstance(dt, datetime):
              return dt.isoformat()
          raise TypeError("{} is neiter an instance of DateTime nor datetime"
                          .format(repr(dt)))
docs: Return the ISO representation of a date object