{"record":{"id":"9e28591a8e041060","repo":"OpenBB-finance/OpenBB","slug":"invalid-date-format-please-use-2024-03-08t12-15","errorCode":null,"errorMessage":"Invalid date format. Please use '2024-03-08T12:15-0400'.","messagePattern":"Invalid date format\\. Please use '2024-03-08T12:15-0400'\\.","errorType":"validation","errorClass":"OpenBBError","httpStatus":null,"severity":"error","filePath":"openbb_platform/providers/intrinio/openbb_intrinio/models/market_snapshots.py","lineNumber":124,"sourceCode":"                dt = transformed_params[\"date\"]  # type: ignore\n                if isinstance(dt, dateType):\n                    dt = datetime(\n                        dt.year,\n                        dt.month,\n                        dt.day,\n                        20,\n                        0,\n                        0,\n                        0,\n                        tzinfo=timezone(\"America/New_York\"),\n                    )\n            if isinstance(transformed_params[\"date\"], str):\n                dt = datetime.fromisoformat(transformed_params[\"date\"])\n            else:\n                try:\n                    dt = datetime.fromisoformat(str(transformed_params[\"date\"]))  # type: ignore\n                except ValueError as exc:\n                    raise OpenBBError(\n                        \"Invalid date format. Please use '2024-03-08T12:15-0400'.\"\n                    ) from exc\n\n            transformed_params[\"date\"] = (\n                dt.strftime(\"%Y-%m-%dT%H:%M:%S.%f%z\")\n                .replace(\"+\", \"-\")\n                .replace(\"T00:\", \"T20:\")\n                if isinstance(dt, datetime)\n                else dt\n            )\n        return IntrinioMarketSnapshotsQueryParams(**transformed_params)\n\n    @staticmethod\n    async def aextract_data(\n        query: IntrinioMarketSnapshotsQueryParams,\n        credentials: dict[str, str] | None,\n        **kwargs: Any,\n    ) -> list[dict]:","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/OpenBB-finance/OpenBB/blob/3e071fcc2cd9f891cac6040ae60296dba76dab46/openbb_platform/providers/intrinio/openbb_intrinio/models/market_snapshots.py#L106-L142","documentation":"OpenBBError raised during market_snapshots transform_query when the supplied date string cannot be parsed by datetime.fromisoformat after str() coercion. The provider expects an ISO-8601 datetime like '2024-03-08T12:15-0400' and tells you so; any non-ISO format (slashes, month names, missing timezone) triggers this before any request is made.","triggerScenarios":"equity/market/snapshots with provider='intrinio' and date='03/08/2024', 'March 8 2024', '2024-03-08 12:15' (space instead of T), or similar non-ISO strings; the ValueError from fromisoformat is caught and converted to OpenBBError.","commonSituations":"Dates coming from user input or other systems (US format MM/DD/YYYY), pandas Timestamps serialized with spaces, or date strings accepted by other providers but not ISO here.","solutions":["Pass the date as ISO-8601 with timezone offset, e.g. '2024-03-08T12:15-0400'.","Normalize upstream: dt.isoformat() or datetime.strptime(raw, YOUR_FORMAT).isoformat() before the call.","Or omit date to use the fetcher's default (most recent snapshot)."],"exampleFix":"# before\nobb.equity.market.snapshots(provider='intrinio', date='03/08/2024')\n\n# after\nfrom datetime import datetime\ndate = datetime.strptime('03/08/2024', '%m/%d/%Y').isoformat()\nobb.equity.market.snapshots(provider='intrinio', date=date)","handlingStrategy":"validation","validationCode":"from datetime import datetime\n\ndef to_intrinio_snapshot_date(raw: str) -> str:\n    for fmt in ('%Y-%m-%dT%H:%M%z', '%m/%d/%Y', '%Y-%m-%d'):\n        try:\n            return datetime.strptime(raw, fmt).isoformat()\n        except ValueError:\n            continue\n    raise ValueError(f\"unrecognized date format: {raw!r}; use '2024-03-08T12:15-0400'\")","typeGuard":"from datetime import datetime\n\ndef is_iso_datetime(s: str) -> bool:\n    try:\n        datetime.fromisoformat(str(s))\n        return True\n    except ValueError:\n        return False","tryCatchPattern":"from openBB_core.provider.exceptions import OpenBBError  # noqa - correct: openbb_core\ntry:\n    res = obb.equity.market.snapshots(provider='intrinio', date=date_str)\nexcept OpenBBError as e:\n    if 'Invalid date format' in str(e):\n        date_str = datetime.strptime(date_str, '%m/%d/%Y').isoformat()\n        res = obb.equity.market.snapshots(provider='intrinio', date=date_str)\n    else:\n        raise","preventionTips":["Always emit dates via datetime.isoformat()","Never pass US MM/DD/YYYY strings directly","Centralize date normalization at the edge of your app","Omit date to use the default latest snapshot when exact time is unimportant"],"tags":["intrinio","market-snapshots","date-format","validation"],"backgroundTag":null,"analyzedSha":"3e071fcc2cd9f891cac6040ae60296dba76dab46","analyzedAt":"2026-08-14T23:40:48.960Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}