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"DATE '{dttm.date().isoformat()}'"
      if isinstance(sqla_type, types.TIMESTAMP):
          datetime_formatted = dttm.isoformat(
              sep=" ", timespec="milliseconds"
          )
          return f"""TIMESTAMP '{datetime_formatted}'"""
      return None
  
file_path: superset/superset/db_engine_specs/athena.py
imports: import re
  from datetime import datetime
  from re import Pattern
  from typing import Any, Optional
  from flask_babel import gettext
  from sqlalchemy import types
  from superset.constants import TimeGrain
  from superset.db_engine_specs.base import BaseEngineSpec
  from superset.errors import SupersetErrorType
label_desc: Use image node_id 1 for calling the AthenaEngineSpec 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, datetime_formatted, str