code: def convert_dttm(
      cls,
      target_type: str,
      dttm: datetime,
      db_extra: Optional[dict[str, Any]] = None,
  ) -> Optional[str]:
      sqla_type = cls.get_sqla_column_type(target_type)
  
      if isinstance(sqla_type, types.Date):
          return f"""datetime({dttm.date().isoformat()})"""
      if isinstance(sqla_type, types.DateTime):
          return (
              f"""datetime({dttm.isoformat(timespec="microseconds")})"""
          )
  
      return None
  
imports: import re
  from datetime import datetime
  from typing import Any, Optional
  from sqlalchemy import types
  from sqlalchemy.dialects.mssql.base import SMALLDATETIME
  from superset.constants import TimeGrain
  from superset.db_engine_specs.base import BaseEngineSpec, LimitMethod
  from superset.db_engine_specs.exceptions import SupersetDBAPIDatabaseError, SupersetDBAPIOperationalError, SupersetDBAPIProgrammingError
  from superset.sql_parse import ParsedQuery
  from superset.utils.core import GenericDataType
label_desc: Use image node_id 2 for calling the KustoKqlEngineSpec obj's underlying member method code with example usage: obj.convert_dttm(cls, target_type, dttm, db_extra) and returns: None, str, dttm, str, str, dttm, str