{"record":{"id":"5d80e4c3f81dc522","repo":"nautechsystems/nautilus_trader","slug":"unrecognized-execution-timezone-tz-str-in-ti","errorCode":null,"errorMessage":"Unrecognized execution timezone '{tz_str}' in '{time_str}'. Configure TWS / IB Gateway to emit a standard timezone (e.g. UTC)","messagePattern":"Unrecognized execution timezone '(.+?)' in '(.+?)'\\. Configure TWS / IB Gateway to emit a standard timezone \\(e\\.g\\. UTC\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/execution/parse.rs","lineNumber":441,"sourceCode":"        localize_with_zone(dt, tz_str, time_str)?\n    };\n\n    datetime_to_unix_nanos(utc, time_str)\n}\n\n/// Localize a naive timestamp against an IB timezone token and convert to UTC.\n///\n/// `Z` is normalized to `UTC`; everything else is resolved through the IANA tz\n/// database. Error and fold behavior is documented on [`parse_execution_time`].\nfn localize_with_zone(dt: DateTime, tz_str: &str, time_str: &str) -> anyhow::Result<Timestamp> {\n    let tz_name = if tz_str.eq_ignore_ascii_case(\"Z\") {\n        \"UTC\"\n    } else {\n        tz_str\n    };\n\n    let zone = get_timezone(tz_name).map_err(|_| {\n        anyhow::anyhow!(\n            \"Unrecognized execution timezone '{tz_str}' in '{time_str}'. Configure TWS / IB Gateway to emit a standard timezone (e.g. UTC)\"\n        )\n    })?;\n    let ambiguous = zone.to_ambiguous_timestamp(dt);\n    match ambiguous.offset() {\n        AmbiguousOffset::Unambiguous { .. } => Ok(ambiguous.unambiguous()?),\n        // Fall-back fold: take the earliest instant (worst case ~1h skew).\n        AmbiguousOffset::Fold { .. } => Ok(ambiguous.earlier()?),\n        AmbiguousOffset::Gap { .. } => {\n            anyhow::bail!(\"Execution timestamp '{time_str}' is non-existent in timezone '{tz_str}'\")\n        }\n    }\n}\n\nfn datetime_to_unix_nanos(dt: Timestamp, time_str: &str) -> anyhow::Result<UnixNanos> {\n    let nanos: u64 = dt\n        .as_nanosecond()\n        .try_into()","sourceCodeStart":423,"sourceCodeEnd":459,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/execution/parse.rs#L423-L459","documentation":"After parsing the naive datetime, parse_execution_time localizes it using the timezone token from the IB timestamp via localize_with_zone. That helper looks the timezone up with get_timezone, and when the token is not a recognized IANA zone or IB abbreviation, this error is thrown, advising the user to configure TWS/Gateway to emit a standard timezone such as UTC.","triggerScenarios":"An execution timestamp like \"20250225 15:15:00 US/Pacific-New\" or any token not resolvable by get_timezone reaches parse_execution_time and is passed to localize_with_zone.","commonSituations":"TWS/IB Gateway set to display times in a non-standard or legacy zone name; tz database differences across machines (missing tzdata on slim Docker images); custom abbreviation like 'CST' that the timezone database rejects.","solutions":["Set the TWS / IB Gateway API timezone (or the machine timezone it reports) to UTC so timestamps arrive in a standard form.","Install/refresh the tz database (tzdata package) in the deployment environment, especially container images.","Map or normalize non-standard zone names to IANA zones (e.g. 'EST5EDT', 'US/Eastern' -> 'America/New_York') before they reach the adapter."],"exampleFix":"// before\nlet zone = get_timezone(tz_str).map_err(|_| {\n    anyhow::anyhow!(\n        \"Unrecognized execution timezone '{tz_str}' in '{time_str}'. ...\"\n    )\n})?;\n// after\nlet tz_name = normalize_zone_alias(tz_str); // e.g. \"EST\" -> \"America/New_York\"\nlet zone = get_timezone(tz_name).map_err(|_| {\n    anyhow::anyhow!(\n        \"Unrecognized execution timezone '{tz_str}' in '{time_str}'. ...\"\n    )\n})?;","handlingStrategy":"validation","validationCode":"// Rust: pre-check the timezone token against the tz database\nfn zone_recognizable(tz_str: &str) -> bool {\n    let name = tz_str.trim();\n    name == \"UTC\" || get_timezone(name).is_ok()\n}","typeGuard":"fn is_iana_zone(tz_str: &str) -> bool {\n    get_timezone(tz_str.trim()).is_ok()\n}","tryCatchPattern":"let zone = match get_timezone(normalize_zone_alias(tz_str)) {\n    Ok(z) => z,\n    Err(_) => {\n        tracing::error!(\"Unknown timezone '{tz_str}' in '{time_str}'; configure TWS/Gateway to UTC\");\n        return Ok(());\n    }\n};","preventionTips":["Configure TWS / IB Gateway to emit UTC timestamps","Ensure tzdata is installed and current in deployment (especially slim Docker images)","Maintain an alias table mapping legacy IB zone names to IANA zones"],"tags":["timezone","timestamp","configuration","interactive-brokers","rust"],"backgroundTag":"invalid-config-value","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}