def METHOD_NAME(
    datetime: Optional[rdfvalue.RDFDatetime]) -> Optional[float]:
  """Converts a datetime object to MySQL `TIMESTAMP(6)` column."""
  if datetime is None:
    return None
  else:
    return "%.6f" % (datetime.AsMicrosecondsSinceEpoch() / 1000000)